9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-25 09:59:15 +00:00

[ci skip] Update auto upstream

This commit is contained in:
Dreeam
2024-07-16 03:47:30 +08:00
parent dbc661af28
commit 2280b95def

View File

@@ -14,14 +14,14 @@ jobs:
with:
path: 'Leaf'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Gale repository
uses: actions/checkout@main
with:
path: 'Gale'
repository: "Dreeam-qwq/Gale"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get Gale latest commit Hash
id: galeCommit
run: |
@@ -29,18 +29,24 @@ jobs:
cd Gale
echo "::set-output name=galeCommit::$(git rev-parse HEAD)"
cd ..
- name: Get Leaf Current Gale commit Hash
id: curGaleRef
run: |
cd Leaf
grep "^galeCommit\s*=" gradle.properties | sed 's/^galeCommit\s*=\s*//'
- name: Update galeCommit in Leaf
run: |
cd Leaf
sed -i "s/\(galeCommit\s*=\s*\).*/\1$PAPER_REF/" gradle.properties
env:
PAPER_REF: ${{ steps.galeCommit.outputs.galeCommit }}
- name: Grant execute permission for gradlew
run: |
git config --global user.name "github-actions"
git config --global user.email no-reply@github.com
git config --global user.name "Dreeam"
git config --global user.email 61569423+Dreeam-qwq@users.noreply.github.com
cd Leaf
chmod +x gradlew
@@ -56,16 +62,19 @@ jobs:
echo "Running tests...."
./gradlew applyPatches
./gradlew createMojmapPaperclipJar
./gradlew rebuildPatches
fi
- name: Check for changes and write to repository
run: |
cd Leaf
if ! git diff --quiet; then
echo "Writing to repo....."
git add .
git commit -m "Updated Upstream (Gale)"
./scripts/upstreamCommit.sh --gale $CUR_GALE_REF
git push
else
echo "No changes to commit."
fi
env:
CUR_GALE_REF: ${{ steps.curGaleRef.outputs.curGaleRef }}