From 209d593e705425c9a11128a7b7a5cba8e518e23e Mon Sep 17 00:00:00 2001 From: DGun Otto Date: Fri, 15 Dec 2023 17:55:00 +0800 Subject: [PATCH 01/12] Workflow --- .github/workflows/automatic-update.yml | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/automatic-update.yml diff --git a/.github/workflows/automatic-update.yml b/.github/workflows/automatic-update.yml new file mode 100644 index 0000000..2eda16c --- /dev/null +++ b/.github/workflows/automatic-update.yml @@ -0,0 +1,44 @@ +name: Automatically update Purpur commit hash +on: + workflow_dispatch: {} + schedule: + - cron: "0 0 * * *" +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout DivineMC Repository + uses: actions/checkout@v3 + with: + path: 'DivineMC' + token: ${{ secrets.HAHAWTH }} + + - name: Checkout Purpur Repository + uses: actions/checkout@v3 + with: + path: 'Purpur' + repository: "PurpurMC/Purpur" + token: ${{ secrets.HAHAWTH }} + + - name: Get Purpur Latest Commit Hash + id: purpurRef + run: | + ls + cd Purpur + echo "::set-output name=purpurRef::$(git rev-parse HEAD)" + cd .. + + - name: Update purpurRef in DivineMC + run: | + sed -i "s/\purpurRef=.*/purpurRef=$PAPER_REF/" DivineMC/gradle.properties + env: + PAPER_REF: ${{ steps.purpurRef.outputs.purpurRef }} + + - name: Write to repository + run: | + cd DivineMC + git add gradle.properties + git config user.name "HaHaWTH" + git config user.email 47356322+HaHaWTH@users.noreply.github.com + git commit -m "Updated Upstream (Purpur)" + git push \ No newline at end of file From f67720029b66ff598d16d53c359e27167e334420 Mon Sep 17 00:00:00 2001 From: DGun Otto Date: Fri, 15 Dec 2023 18:01:42 +0800 Subject: [PATCH 02/12] Update --- .github/workflows/automatic-update.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automatic-update.yml b/.github/workflows/automatic-update.yml index 2eda16c..63d7385 100644 --- a/.github/workflows/automatic-update.yml +++ b/.github/workflows/automatic-update.yml @@ -11,14 +11,14 @@ jobs: uses: actions/checkout@v3 with: path: 'DivineMC' - token: ${{ secrets.HAHAWTH }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Checkout Purpur Repository uses: actions/checkout@v3 with: path: 'Purpur' repository: "PurpurMC/Purpur" - token: ${{ secrets.HAHAWTH }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Get Purpur Latest Commit Hash id: purpurRef From 9d0b1184a1aace218ed5c24684d481a14c09f485 Mon Sep 17 00:00:00 2001 From: DGun Otto Date: Fri, 15 Dec 2023 21:08:42 +0800 Subject: [PATCH 03/12] Update automatic-update.yml --- .github/workflows/automatic-update.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automatic-update.yml b/.github/workflows/automatic-update.yml index 63d7385..9036e48 100644 --- a/.github/workflows/automatic-update.yml +++ b/.github/workflows/automatic-update.yml @@ -30,15 +30,23 @@ jobs: - name: Update purpurRef in DivineMC run: | - sed -i "s/\purpurRef=.*/purpurRef=$PAPER_REF/" DivineMC/gradle.properties + cd DivineMC + echo "Before sed:" + cat gradle.properties + sed -i "s/\purpurRef=.*/purpurRef=$PAPER_REF/" gradle.properties + echo "After sed:" + cat gradle.properties env: PAPER_REF: ${{ steps.purpurRef.outputs.purpurRef }} - name: Write to repository run: | cd DivineMC + echo "Current directory: $(pwd)" + git status git add gradle.properties + git status git config user.name "HaHaWTH" git config user.email 47356322+HaHaWTH@users.noreply.github.com git commit -m "Updated Upstream (Purpur)" - git push \ No newline at end of file + git push From e3f39c403426cfe2df3dbc66950e0450d3f6440a Mon Sep 17 00:00:00 2001 From: DGun Otto Date: Fri, 15 Dec 2023 21:12:49 +0800 Subject: [PATCH 04/12] Update automatic-update.yml --- .github/workflows/automatic-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automatic-update.yml b/.github/workflows/automatic-update.yml index 9036e48..71038d3 100644 --- a/.github/workflows/automatic-update.yml +++ b/.github/workflows/automatic-update.yml @@ -33,7 +33,7 @@ jobs: cd DivineMC echo "Before sed:" cat gradle.properties - sed -i "s/\purpurRef=.*/purpurRef=$PAPER_REF/" gradle.properties + sed -i "s/\(purpurRef\s*=\s*\).*/\1$PAPER_REF/" gradle.properties echo "After sed:" cat gradle.properties env: From 523e30e1fa1889fbbb3a267f3ef1b0af5dbc1f8c Mon Sep 17 00:00:00 2001 From: HaHaWTH <47356322+HaHaWTH@users.noreply.github.com> Date: Fri, 15 Dec 2023 13:13:14 +0000 Subject: [PATCH 05/12] Updated Upstream (Purpur) --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 4c9603c..1006020 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group = gq.bxteam.divinemc version = 1.20.4-R0.1-SNAPSHOT -purpurRef = 93177c47b848cd9c23aa3b0fd5c134c83221d30c +purpurRef = 9e1216de506439171c08773730faea0f0a617a83 org.gradle.caching = true org.gradle.parallel = true From e72e3f0e0574b657ae3228c7babcab43712b2967 Mon Sep 17 00:00:00 2001 From: DGun Otto Date: Fri, 15 Dec 2023 21:15:03 +0800 Subject: [PATCH 06/12] Remove debug --- .github/workflows/automatic-update.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/automatic-update.yml b/.github/workflows/automatic-update.yml index 71038d3..fb44848 100644 --- a/.github/workflows/automatic-update.yml +++ b/.github/workflows/automatic-update.yml @@ -31,21 +31,14 @@ jobs: - name: Update purpurRef in DivineMC run: | cd DivineMC - echo "Before sed:" - cat gradle.properties sed -i "s/\(purpurRef\s*=\s*\).*/\1$PAPER_REF/" gradle.properties - echo "After sed:" - cat gradle.properties env: PAPER_REF: ${{ steps.purpurRef.outputs.purpurRef }} - name: Write to repository run: | cd DivineMC - echo "Current directory: $(pwd)" - git status git add gradle.properties - git status git config user.name "HaHaWTH" git config user.email 47356322+HaHaWTH@users.noreply.github.com git commit -m "Updated Upstream (Purpur)" From b9518838c37250c3034d8ad98317a4acf692758d Mon Sep 17 00:00:00 2001 From: DGun Otto Date: Fri, 15 Dec 2023 21:17:32 +0800 Subject: [PATCH 07/12] Update automatic-update.yml --- .github/workflows/automatic-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automatic-update.yml b/.github/workflows/automatic-update.yml index fb44848..1a7a323 100644 --- a/.github/workflows/automatic-update.yml +++ b/.github/workflows/automatic-update.yml @@ -40,6 +40,6 @@ jobs: cd DivineMC git add gradle.properties git config user.name "HaHaWTH" - git config user.email 47356322+HaHaWTH@users.noreply.github.com + git config user.email HaHaWTH@users.noreply.github.com git commit -m "Updated Upstream (Purpur)" git push From 493f40c31ae1bafa5d8cbc70799b718a996a870c Mon Sep 17 00:00:00 2001 From: DGun Otto Date: Sat, 16 Dec 2023 18:02:09 +0800 Subject: [PATCH 08/12] test --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 1006020..818082b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group = gq.bxteam.divinemc version = 1.20.4-R0.1-SNAPSHOT -purpurRef = 9e1216de506439171c08773730faea0f0a617a83 +purpurRef = tdd org.gradle.caching = true org.gradle.parallel = true From e0c7ae76bcca3c94a425cde23ea340b2e2fc2ee5 Mon Sep 17 00:00:00 2001 From: HaHaWTH Date: Sat, 16 Dec 2023 10:02:30 +0000 Subject: [PATCH 09/12] Updated Upstream (Purpur) --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 818082b..1006020 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group = gq.bxteam.divinemc version = 1.20.4-R0.1-SNAPSHOT -purpurRef = tdd +purpurRef = 9e1216de506439171c08773730faea0f0a617a83 org.gradle.caching = true org.gradle.parallel = true From 8d30817c86a17dfb4c2c9c55cf133a5d42099400 Mon Sep 17 00:00:00 2001 From: DGun Otto Date: Sun, 17 Dec 2023 00:46:27 +0800 Subject: [PATCH 10/12] Update automatic-update.yml --- .github/workflows/automatic-update.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/automatic-update.yml b/.github/workflows/automatic-update.yml index 1a7a323..341a5d8 100644 --- a/.github/workflows/automatic-update.yml +++ b/.github/workflows/automatic-update.yml @@ -34,7 +34,13 @@ jobs: sed -i "s/\(purpurRef\s*=\s*\).*/\1$PAPER_REF/" gradle.properties env: PAPER_REF: ${{ steps.purpurRef.outputs.purpurRef }} - + - name: Check for changes + run: | + cd DivineMC + if git diff --quiet; then + echo "No changes to commit." + exit 0 + fi - name: Write to repository run: | cd DivineMC From 8af1f241b96590c90dbf4227856245343b366c61 Mon Sep 17 00:00:00 2001 From: DGun Otto Date: Sun, 17 Dec 2023 00:50:30 +0800 Subject: [PATCH 11/12] Update automatic-update.yml --- .github/workflows/automatic-update.yml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/automatic-update.yml b/.github/workflows/automatic-update.yml index 341a5d8..8217dd3 100644 --- a/.github/workflows/automatic-update.yml +++ b/.github/workflows/automatic-update.yml @@ -34,18 +34,15 @@ jobs: sed -i "s/\(purpurRef\s*=\s*\).*/\1$PAPER_REF/" gradle.properties env: PAPER_REF: ${{ steps.purpurRef.outputs.purpurRef }} - - name: Check for changes - run: | - cd DivineMC - if git diff --quiet; then - echo "No changes to commit." - exit 0 - fi - - name: Write to repository + - name: Check for changes and Write to repository run: | cd DivineMC - git add gradle.properties - git config user.name "HaHaWTH" - git config user.email HaHaWTH@users.noreply.github.com - git commit -m "Updated Upstream (Purpur)" - git push + if ! git diff --quiet; then + git add gradle.properties + git config user.name "HaHaWTH" + git config user.email HaHaWTH@users.noreply.github.com + git commit -m "Updated Upstream (Purpur)" + git push + else + echo "No changes to commit." + fi From f69f84d8718c8f31aef8f82261d4ee03e1a64384 Mon Sep 17 00:00:00 2001 From: HaHaWTH Date: Mon, 18 Dec 2023 00:57:00 +0000 Subject: [PATCH 12/12] Updated Upstream (Purpur) --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 1006020..adcc62c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group = gq.bxteam.divinemc version = 1.20.4-R0.1-SNAPSHOT -purpurRef = 9e1216de506439171c08773730faea0f0a617a83 +purpurRef = eb3b67d5b277d279c4ff67322a49fc5f0764ad82 org.gradle.caching = true org.gradle.parallel = true