9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-03 22:26:19 +00:00

Init 1.21.5 setup

This commit is contained in:
Dreeam
2025-03-26 11:19:18 -04:00
parent 1e36d848c2
commit 2fe143b468
10 changed files with 75 additions and 81 deletions

View File

@@ -1,9 +1,9 @@
name: Automatically update Gale commit hash
name: Automatically update Paper commit hash
on:
workflow_dispatch:
schedule:
- cron: "0 1 * * *"
- cron: "0 0 * * *"
jobs:
build:
@@ -15,32 +15,32 @@ jobs:
path: 'Leaf'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Gale repository
- name: Checkout Paper repository
uses: actions/checkout@main
with:
path: 'Gale'
repository: "Dreeam-qwq/Gale"
path: 'Paper'
repository: "PaperMC/Paper"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get Gale latest commit Hash
id: galeCommit
- name: Get Paper latest commit Hash
id: paperCommit
run: |
cd Gale
echo "galeCommit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
cd Paper
echo "paperCommit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Get Leaf Current Gale commit Hash
id: currGaleRef
- name: Get Leaf Current Paper commit Hash
id: currPaperCommit
run: |
cd Leaf
currGaleRef=$(grep "^galeCommit\s*=" gradle.properties | sed 's/^galeCommit\s*=\s*//')
echo "currGaleRef=$currGaleRef" >> $GITHUB_OUTPUT
currPaperCommit=$(grep "^paperCommit\s*=" gradle.properties | sed 's/^paperCommit\s*=\s*//')
echo "currPaperCommit=$currPaperCommit" >> $GITHUB_OUTPUT
- name: Update galeCommit in Leaf
- name: Update paperCommit in Leaf
run: |
cd Leaf
sed -i "s/\(galeCommit\s*=\s*\).*/\1$PAPER_REF/" gradle.properties
sed -i "s/\(paperCommit\s*=\s*\).*/\1$PAPER_COMMIT/" gradle.properties
env:
PAPER_REF: ${{ steps.galeCommit.outputs.galeCommit }}
PAPER_COMMIT: ${{ steps.paperCommit.outputs.paperCommit }}
- name: Grant execute permission for gradlew
run: |
@@ -61,7 +61,7 @@ jobs:
echo "Running tests...."
./gradlew applyAllPatches
./gradlew build -x test
./gradlew rebuildGalePatches
./gradlew rebuildPaperPatches
./gradlew rebuildAllServerPatches
fi
@@ -72,10 +72,10 @@ jobs:
echo "Writing to repo....."
git add .
chmod +x ./scripts/upstreamCommit.sh
./scripts/upstreamCommit.sh --gale $CURR_GALE_REF
./scripts/upstreamCommit.sh --paper $CURR_PAPER_COMMIT
git push
else
echo "No changes to commit."
fi
env:
CURR_GALE_REF: ${{ steps.currGaleRef.outputs.currGaleRef }}
CURR_PAPER_COMMIT: ${{ steps.currPaperCommit.outputs.currPaperCommit }}