Skip to content

Commit

Permalink
Fix AlwaysUpToDate
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaKR93 committed Jun 4, 2024
1 parent 809aed7 commit 0a29c12
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
uses: softprops/[email protected]
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
Expand Down
39 changes: 28 additions & 11 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,39 @@ name: Always Up To Date
on:
workflow_dispatch:
schedule:
- cron: "*/10 * * * *"
- cron: "*/20 * * * *"

jobs:
prepare:
name: Prepare Actions
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)')
Expand All @@ -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
Expand All @@ -36,41 +61,33 @@ 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 "[email protected]" && 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 }}

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
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ plazmaRef = dev/1.20.6
jdkVersion = 21

# Volt - Use ./gradlew updateUpstream to update this value
plazmaCommit = e6586daeaa6f14a92f69d6107078b0601918fb36
plazmaCommit = c531844986447fc224836a74bff6290fea758253

0 comments on commit 0a29c12

Please sign in to comment.