From 1fa323987aa14f03583626c968ebd59563431843 Mon Sep 17 00:00:00 2001 From: DGun Otto Date: Mon, 18 Dec 2023 09:41:25 +0800 Subject: [PATCH] Fix workflow (#15) * Create auto-update.yml * Update auto-update.yml * Update auto-update.yml * Updated Upstream (Gale) * Update auto-update.yml * Update auto-update.yml * Updated Upstream (Gale) * Update auto-update.yml * Update gradle.properties * Updated Upstream (Gale) * test * Updated Upstream (Gale) * Update auto-update.yml * test * Updated Upstream (Gale) * Update auto-update.yml * test * Update auto-update.yml * Update auto-update.yml * Update auto-update.yml * Updated Upstream (Gale) * Update auto-update.yml * Update auto-update.yml * Update auto-update.yml * Update auto-update.yml * Update auto-update.yml * Update gradle.properties --------- Co-authored-by: HaHaWTH Co-authored-by: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> --- .github/workflows/auto-update.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 6f7dc85ea..50e714536 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -1,8 +1,10 @@ name: Automatically update Gale commit hash + on: workflow_dispatch: {} schedule: - cron: "0 0 * * *" + jobs: build: runs-on: ubuntu-latest @@ -34,10 +36,26 @@ jobs: 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: | + cd Leaf + chmod +x gradlew + + - name: Running tests before push + run: | + cd Leaf + if ! git diff --quiet; then + echo "Running tests...." + ./gradlew applyPatches + ./gradlew createReobfPaperclipJar + fi + - name: Check for changes and Write to repository run: | cd Leaf if ! git diff --quiet; then + echo "Writing to repo....." git add gradle.properties git config --global user.name "github-actions" git config --global user.email no-reply@github.com @@ -45,4 +63,4 @@ jobs: git push else echo "No changes to commit." - fi + fi \ No newline at end of file