Skip to content

Commit

Permalink
update to gradle/actions/setup-gradle@v3, enable caching
Browse files Browse the repository at this point in the history
  • Loading branch information
desht committed Jul 24, 2024
1 parent 1546e91 commit 0179e57
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ jobs:
- name: Remove any generated assets/data
run: rm -rf ./src/generated
- name: Generate assets & data
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false
arguments: runData --no-daemon
- name: Validate assets
run: test -d ./src/generated -a -d ./src/generated/resources/.cache
Expand All @@ -33,15 +34,17 @@ jobs:
run: |
echo mc_version=$(grep ^minecraft_version= ./gradle.properties | cut -d= -f2) >> $GITHUB_OUTPUT
- name: Build JAR
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false
arguments: build --no-daemon
- name: Publish to Modmaven
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
env:
MODMAVEN_USER: ${{ secrets.MODMAVEN_USER }}
MODMAVEN_PASSWORD: ${{ secrets.MODMAVEN_PASSWORD }}
with:
cache-read-only: false
arguments: publishMavenPublicationToModmavenRepository --no-daemon
- name: Discord notification
uses: Ilshidur/action-discord@master
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ jobs:
- name: Remove any generated assets/data
run: rm -rf ./src/generated
- name: Generate assets & data
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false
arguments: runData --no-daemon
- name: Validate assets
run: test -d ./src/generated -a -d ./src/generated/resources/.cache
- name: Build JAR
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false
arguments: build --no-daemon
env:
BUILD_NUMBER: ${{ github.run_number }}
Expand All @@ -44,19 +46,21 @@ jobs:
echo mod_version=$(grep ^mod_version= ./gradle.properties | cut -d= -f2) >> $GITHUB_OUTPUT
echo mc_version=$(grep ^minecraft_version= ./gradle.properties | cut -d= -f2) >> $GITHUB_OUTPUT
- name: Publish to Modmaven
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
env:
MODMAVEN_USER: ${{ secrets.MODMAVEN_USER }}
MODMAVEN_PASSWORD: ${{ secrets.MODMAVEN_PASSWORD }}
with:
cache-read-only: false
arguments: publishMavenPublicationToModmavenRepository --no-daemon
- name: Publish to Curseforge/Modrinth
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
env:
CHANGELOG: ${{ github.event.release.body }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
BUILD_NUMBER: ${{ github.run_number }}
with:
cache-read-only: false
arguments: publishMods --no-daemon

0 comments on commit 0179e57

Please sign in to comment.