From 57184b7146c06f3166f2e4030f76a2b123214045 Mon Sep 17 00:00:00 2001 From: Asriel Camora Date: Fri, 25 Apr 2025 00:31:48 -0700 Subject: [PATCH] Add applying upstream cron job --- .github/workflows/apply-downstream.yml | 54 ++++++++++++++++++++++++++ .github/workflows/create-release.yml | 8 +++- 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/apply-downstream.yml diff --git a/.github/workflows/apply-downstream.yml b/.github/workflows/apply-downstream.yml new file mode 100644 index 0000000..c65aab0 --- /dev/null +++ b/.github/workflows/apply-downstream.yml @@ -0,0 +1,54 @@ +name: Apply Downstream Changes +on: + schedule: + - cron: '0 0 * * *' # Every midnight + workflow_dispatch: + +concurrency: + group: ${{github.workflow}} + cancel-in-progress: true + +permissions: + contents: write + packages: write + +jobs: + apply-downstream: + name: Apply Downstream + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Download EXDTools + uses: robinraju/release-downloader@v1 + with: + repository: xivdev/EXDTools + fileName: 'EXDTooler' + latest: true + + - name: Chmod Executable + run: chmod +x EXDTooler + + - name: Checkout submodules to branch + run: git submodule foreach 'git checkout $(git describe --all HEAD | sed -En "s/(remotes\/origin\/|heads\/)//p")' + + - name: Run Column Merger + run: ./EXDTooler merge-columns -b schemas + + - name: Commit Changes + run: | + rm EXDTooler + git config --global user.name github-actions[bot] + git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com + git submodule foreach ' + git add . + git commit -m "Upstream changes" || : + git push + ' + git add --all + git commit -m "Update submodules" || : + git push \ No newline at end of file diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 3ae4c67..3cd1b37 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -52,9 +52,13 @@ jobs: rm apply.py git config --global user.name github-actions[bot] git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com - git submodule foreach 'git add .; git commit -m "Creating release"; git push' + git submodule foreach ' + git add . + git commit -m "Creating release" || : + git push + ' git add --all - git commit -m "Update submodules" + git commit -m "Update submodules" || : git push - name: Zip submodules