From 0179e57b41daba4977084c9d536c21e264f13492 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Wed, 24 Jul 2024 17:54:34 +0100 Subject: [PATCH] update to gradle/actions/setup-gradle@v3, enable caching --- .github/workflows/main.yml | 9 ++++++--- .github/workflows/release.yml | 12 ++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4a05d7a9..03948a5a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5be95d0b..3ef482c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} @@ -44,14 +46,15 @@ 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 }} @@ -59,4 +62,5 @@ jobs: DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }} BUILD_NUMBER: ${{ github.run_number }} with: + cache-read-only: false arguments: publishMods --no-daemon \ No newline at end of file