mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Generalize submodules workflow to add Lumina.Excel (#2340)
Some checks are pending
Some checks are pending
This commit is contained in:
parent
f07b308757
commit
5b5fdc0c10
1 changed files with 18 additions and 11 deletions
29
.github/workflows/update-submodules.yml
vendored
29
.github/workflows/update-submodules.yml
vendored
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue