Generalize submodules workflow to add Lumina.Excel (#2340)
Some checks are pending
Build Dalamud / Build on Windows (push) Waiting to run
Build Dalamud / Check API Compatibility (push) Blocked by required conditions
Build Dalamud / Deploy dalamud-distrib staging (push) Blocked by required conditions
Tag Build / Tag Build (push) Successful in 2s

This commit is contained in:
Asriel 2025-09-10 16:55:25 -07:00 committed by GitHub
parent f07b308757
commit 5b5fdc0c10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,16 +1,23 @@
name: Check for FFXIVCS changes name: Check for Submodule Changes
on: on:
schedule: schedule:
- cron: "0 0,12,18 */1 * *" - cron: "0 0,12,18 * * *"
workflow_dispatch: workflow_dispatch:
jobs: jobs:
check: check:
name: FFXIVCS Check name: Check ${{ matrix.submodule.name }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
branches: [master] branches: [master]
submodule:
- name: ClientStructs
path: lib/FFXIVClientStructs
branch-prefix: csupdate
- name: Excel Schema
path: lib/Lumina.Excel
branch-prefix: schemaupdate
defaults: defaults:
run: run:
@ -24,7 +31,7 @@ jobs:
ref: ${{ matrix.branches }} ref: ${{ matrix.branches }}
token: ${{ secrets.UPDATE_PAT }} token: ${{ secrets.UPDATE_PAT }}
- name: Create update branch - 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 - name: Initialize mandatory git config
run: | run: |
git config --global user.name "github-actions[bot]" git config --global user.name "github-actions[bot]"
@ -32,22 +39,22 @@ jobs:
git config --global pull.rebase false git config --global pull.rebase false
- name: Update submodule - name: Update submodule
run: | run: |
git checkout -b csupdate-${{ matrix.branches }} git checkout -b ${{ matrix.submodule.branch-prefix }}-${{ matrix.branches }}
git reset --hard origin/${{ matrix.branches }} git reset --hard origin/${{ matrix.branches }}
cd lib/FFXIVClientStructs cd ${{ matrix.submodule.path }}
git fetch git fetch
git reset --hard origin/main git reset --hard origin/main
cd ../.. cd ../..
git add lib/FFXIVClientStructs git add ${{ matrix.submodule.path }}
git commit --message "Update ClientStructs" git commit --message "Update ${{ matrix.submodule.name }}"
git push origin csupdate-${{ matrix.branches }} --force git push origin ${{ matrix.submodule.branch-prefix }}-${{ matrix.branches }} --force
- name: Create PR - name: Create PR
run: | run: |
echo ${{ secrets.UPDATE_PAT }} | gh auth login --with-token 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 if [ -z "$prNumber" ]; then
echo "No PR found, creating one" 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 else
echo "PR already exists, ignoring" echo "PR already exists, ignoring"
fi fi