From 4636b78a0ab5868a213251a7c0aaa6e32094b204 Mon Sep 17 00:00:00 2001 From: Deximus-Maximus Date: Thu, 7 Sep 2023 10:39:23 -0400 Subject: [PATCH] Update action script --- .github/workflows/gradle.yml | 51 ++++++++++++++++++++++-------------- build.gradle | 4 +-- 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 104a69a..4074af4 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -3,24 +3,37 @@ name: Java CI on: [push] jobs: - build: - + publish: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Set up JDK 17 - uses: actions/setup-java@v1 - with: - java-version: 17 - - name: Build with Gradle - run: ./gradlew build - - name: Publish to Distributors - env: - KEY_STORE_PASS: ${{ secrets.KEY_STORE_PASS }} - KEY_STORE_ALIAS: ${{ secrets.KEY_STORE_ALIAS }} - KEY_STORE_KEY_PASS: ${{ secrets.KEY_STORE_KEY_PASS }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - MODRINTH: ${{ secrets.MODRINTH }} - CURSE: ${{ secrets.CURSE }} - run: ./gradlew publish + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'zulu' + + - name: Cache Gradle files + uses: actions/cache@v2 + if: ${{ !env.ACT }} + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('*/build.gradle', '*/settings.gradle', '*gradle.*') }} + restore-keys: ${{ runner.os }}-gradle- + + - name: Make gradlew executable + run: chmod +x ./gradlew + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + arguments: | + publish + env: + KEY_STORE_PASS: ${{ secrets.KEY_STORE_PASS }} + KEY_STORE_ALIAS: ${{ secrets.KEY_STORE_ALIAS }} + KEY_STORE_KEY_PASS: ${{ secrets.KEY_STORE_KEY_PASS }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MODRINTH: ${{ secrets.MODRINTH }} + CURSE: ${{ secrets.CURSE }} \ No newline at end of file diff --git a/build.gradle b/build.gradle index b26b580..a6ba93f 100644 --- a/build.gradle +++ b/build.gradle @@ -5,10 +5,10 @@ buildscript { } plugins { - id 'fabric-loom' version '1.3.9' + id 'fabric-loom' version '1.3.+' //id 'org.gradle.toolchains.foojay-resolver-convention' version "0.5.0" //id "com.github.fudge.forgedflowerloom" version "2.0.0" - id 'io.github.juuxel.loom-vineflower' version '1.11.0' + id 'io.github.juuxel.loom-vineflower' version '1.+' id 'maven-publish' id "com.modrinth.minotaur" version "2.+" id 'com.matthewprenger.cursegradle' version '1.4.+'