From 5b5fdc0c10d411cc65078d16ce420d68b9d2b965 Mon Sep 17 00:00:00 2001 From: Asriel Date: Wed, 10 Sep 2025 16:55:25 -0700 Subject: [PATCH] Generalize submodules workflow to add Lumina.Excel (#2340) --- .github/workflows/update-submodules.yml | 29 +++++++++++++++---------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/update-submodules.yml b/.github/workflows/update-submodules.yml index 19bd86b30..61a900395 100644 --- a/.github/workflows/update-submodules.yml +++ b/.github/workflows/update-submodules.yml @@ -1,16 +1,23 @@ -name: Check for FFXIVCS changes +name: Check for Submodule Changes on: schedule: - - cron: "0 0,12,18 */1 * *" + - cron: "0 0,12,18 * * *" workflow_dispatch: jobs: check: - name: FFXIVCS Check + name: Check ${{ matrix.submodule.name }} runs-on: ubuntu-latest strategy: matrix: branches: [master] + submodule: + - name: ClientStructs + path: lib/FFXIVClientStructs + branch-prefix: csupdate + - name: Excel Schema + path: lib/Lumina.Excel + branch-prefix: schemaupdate defaults: run: @@ -24,7 +31,7 @@ jobs: ref: ${{ matrix.branches }} token: ${{ secrets.UPDATE_PAT }} - name: Create update branch - run: git checkout -b csupdate/${{ matrix.branches }} + run: git checkout -b ${{ matrix.submodule.branch-prefix }}/${{ matrix.branches }} - name: Initialize mandatory git config run: | git config --global user.name "github-actions[bot]" @@ -32,22 +39,22 @@ jobs: git config --global pull.rebase false - name: Update submodule run: | - git checkout -b csupdate-${{ matrix.branches }} + git checkout -b ${{ matrix.submodule.branch-prefix }}-${{ matrix.branches }} git reset --hard origin/${{ matrix.branches }} - cd lib/FFXIVClientStructs + cd ${{ matrix.submodule.path }} git fetch git reset --hard origin/main cd ../.. - git add lib/FFXIVClientStructs - git commit --message "Update ClientStructs" - git push origin csupdate-${{ matrix.branches }} --force + git add ${{ matrix.submodule.path }} + git commit --message "Update ${{ matrix.submodule.name }}" + git push origin ${{ matrix.submodule.branch-prefix }}-${{ matrix.branches }} --force - name: Create PR run: | echo ${{ secrets.UPDATE_PAT }} | gh auth login --with-token - prNumber=$(gh pr list --base ${{ matrix.branches }} --head csupdate-${{ matrix.branches }} --state open --json number --template "{{range .}}{{.number}}{{end}}") + prNumber=$(gh pr list --base ${{ matrix.branches }} --head ${{ matrix.submodule.branch-prefix }}-${{ matrix.branches }} --state open --json number --template "{{range .}}{{.number}}{{end}}") if [ -z "$prNumber" ]; then echo "No PR found, creating one" - gh pr create --head csupdate-${{ matrix.branches }} --title "[${{ matrix.branches }}] Update ClientStructs" --body "" --base ${{ matrix.branches }} + gh pr create --head ${{ matrix.submodule.branch-prefix }}-${{ matrix.branches }} --title "[${{ matrix.branches }}] Update ${{ matrix.submodule.name }}" --body "" --base ${{ matrix.branches }} else echo "PR already exists, ignoring" fi