From 0a29c12f7e11d4c1f42c34ba7742452e56cac108 Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Wed, 5 Jun 2024 07:49:42 +0900 Subject: [PATCH] Fix AlwaysUpToDate --- .github/workflows/release.yml | 2 +- .github/workflows/upstream.yml | 39 ++++++++++++++++++++++++---------- README.md | 8 ++++++- gradle.properties | 2 +- 4 files changed, 37 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d2b169b..85b274d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,7 +49,7 @@ jobs: uses: softprops/action-gh-release@v0.1.15 with: name: "Release for ${{ github.ref_name }}" - tag_name: ${{ github.ref_name }} + tag_name: release/${{ github.ref_name }} target_commitish: ${{ github.ref_name }} generate_release_notes: true fail_on_unmatched_files: true diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index cf5c186..a993a1b 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -2,7 +2,7 @@ name: Always Up To Date on: workflow_dispatch: schedule: - - cron: "*/10 * * * *" + - cron: "*/20 * * * *" jobs: prepare: @@ -10,8 +10,31 @@ jobs: runs-on: ubuntu-latest outputs: matrix: ${{ steps.matrix.outputs.matrix }} + require: ${{ steps.require.outputs.require }} steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: base + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 21 + + - name: Determine if update is required + id: require + run: | + REQUIRE=$(./gradlew -q checkNeedsUpdate) + echo "$REQUIRE." + echo "require=$REQUIRE" >> $GITHUB_OUTPUT + - name: Pull Branches + if: steps.require.outputs.require == 'false' id: matrix run: | respond=$(curl --silent https://api.github.com/repos/plazmamc/thunderbolt/branches | jq -rc 'del(.[]|.protected) | del(.[]|.commit)') @@ -20,7 +43,9 @@ jobs: upstream: name: Update Base Upstream + needs: prepare runs-on: ubuntu-latest + if: needs.prepare.outputs.require == 'true' steps: - name: Checkout repository uses: actions/checkout@v4 @@ -36,32 +61,22 @@ jobs: distribution: zulu java-version: 21 - - name: Determine if update is required - id: check - run: echo "needs=$(./gradlew -q checkNeedsUpdate)" >> $GITHUB_OUTPUT - - name: Configure Git - if: steps.check.outputs.needs == 'true' run: git config --global user.email "action@github.com" && git config --global user.name "Github Action" - name: Update upstream - if: steps.check.outputs.needs == 'true' run: ./gradlew updateUpstream - name: Apply patches - if: steps.check.outputs.needs == 'true' run: ./gradlew applyPatches - name: Check build - if: steps.check.outputs.needs == 'true' run: ./gradlew build - name: Commit changes - if: steps.check.outputs.needs == 'true' run: git add . && printf "Updated Upstream (Plazma)\n\nUpstream has released updates that appear to apply and compile correctly\n\n$(cat compare.txt)" | git commit -F - - name: Push changes - if: steps.check.outputs.needs == 'true' uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -69,8 +84,10 @@ jobs: flavor: name: Update Flavors Upstream needs: prepare + if: needs.prepare.outputs.require == 'false' runs-on: ubuntu-latest strategy: + fail-fast: false matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: - name: Checkout repository diff --git a/README.md b/README.md index 1eaa3d6..864068a 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,14 @@ ## 🎨 Flavors -- Vanilla (Base Flavor) +- [Vanilla (Base Flavor)](https://github.com/PlazmaMC/Thunderbolt/releases/tag/release/base) - Implemented [Noisium](https://modrinth.com/mod/noisium) +- [feat/remove-timings](https://github.com/PlazmaMC/Thunderbolt/releases/tag/release/feat/remove-timings) + - All features from base + - Remove all timings related implementations except API access (Exception occurs when accessing API) +- [feat/sector-file](https://github.com/PlazmaMC/Thunderbolt/releases/tag/release/feat/sector-file) + - All features from base + - Implements Paper's new [Sector File](https://github.com/PaperMC/Paper/pull/10231) ## ⚖️ License diff --git a/gradle.properties b/gradle.properties index 008e796..018ab30 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,4 +22,4 @@ plazmaRef = dev/1.20.6 jdkVersion = 21 # Volt - Use ./gradlew updateUpstream to update this value -plazmaCommit = e6586daeaa6f14a92f69d6107078b0601918fb36 +plazmaCommit = c531844986447fc224836a74bff6290fea758253