From 596bc7db277b572de2b46fc0a749f47e25055181 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Mon, 25 Nov 2024 22:11:08 +0000 Subject: [PATCH] update CI (deprecated gradle action usage) --- .github/workflows/main.yml | 19 ++++++------------- .github/workflows/release.yml | 26 +++++++++----------------- 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1f4b0087..1b31cdf0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,30 +22,23 @@ jobs: uses: gradle/wrapper-validation-action@v1 - name: Remove any generated assets/data run: rm -rf ./src/generated - - name: Generate assets & data - uses: gradle/actions/setup-gradle@v3 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 with: cache-read-only: false - arguments: runData --no-daemon + - name: Generate assets & data + run: ./gradlew runData --no-daemon - name: Validate assets run: test -d ./src/generated -a -d ./src/generated/resources/.cache - name: Set up mod metadata id: mod_meta run: | echo mc_version=$(grep ^minecraft_version= ./gradle.properties | cut -d= -f2) >> $GITHUB_OUTPUT - - name: Build JAR - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - arguments: build --no-daemon - - name: Publish to Modmaven - uses: gradle/actions/setup-gradle@v3 + - name: Build JAR and Publish to Modmaven + run: ./gradlew build publishMavenPublicationToModmavenRepository --no-daemon 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 env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3ef482c6..c81848b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,20 +24,18 @@ jobs: java-version: '21' - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v1 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + with: + cache-read-only: false - name: Remove any generated assets/data run: rm -rf ./src/generated - name: Generate assets & data - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - arguments: runData --no-daemon + run: ./gradlew runData --no-daemon - name: Validate assets run: test -d ./src/generated -a -d ./src/generated/resources/.cache - name: Build JAR - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - arguments: build --no-daemon + run: ./gradlew build --no-daemon env: BUILD_NUMBER: ${{ github.run_number }} - name: Set up mod metadata @@ -46,21 +44,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/actions/setup-gradle@v3 + run: ./gradlew publishMavenPublicationToModmavenRepository --no-daemon 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/actions/setup-gradle@v3 + run: ./gradlew publishMods --no-daemon 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 \ No newline at end of file + BUILD_NUMBER: ${{ github.run_number }} \ No newline at end of file