From f7d6328cda89223f06ca3f40e2434c9ad99a7e15 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Sun, 1 Dec 2024 10:16:04 -0500 Subject: [PATCH] Update workflows --- .github/workflows/build.yml | 21 +++++++++++++++------ .github/workflows/release.yml | 35 ++++++++++++++++++++--------------- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45cf5ece..ecb3204d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,12 +9,21 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Setup JDK 17 - uses: actions/setup-java@v4 + - name: Setup Java + run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> "$GITHUB_ENV" + + - name: Loom Cache + uses: actions/cache@v4 + with: + path: "**/.gradle/loom-cache" + key: "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}" + restore-keys: "${{ runner.os }}-gradle-" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 with: - java-version: '17' - distribution: temurin - cache: gradle + gradle-home-cache-cleanup: true + cache-read-only: ${{ !endsWith(github.ref_name, '/dev') }} - name: Validate Gradle Wrapper Integrity uses: gradle/wrapper-validation-action@v2 @@ -22,4 +31,4 @@ jobs: - name: Build & Publish to Maven env: MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} - run: ./gradlew build publish + run: ./gradlew build publish \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da4cb8fa..a9b3fcd9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,29 +14,34 @@ on: jobs: build: runs-on: ubuntu-latest - env: - RELEASE_BUILD: true - MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} - CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} - MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} - PLATFORM: ${{ inputs.platform }} - steps: - name: Checkout Repository uses: actions/checkout@v4 - - name: Setup JDK 17 - uses: actions/setup-java@v4 + - name: Setup Java + run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> "$GITHUB_ENV" + + - name: Loom Cache + uses: actions/cache@v4 with: - java-version: '17' - distribution: temurin - cache: gradle + path: "**/.gradle/loom-cache" + key: "${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}" + restore-keys: "${{ runner.os }}-gradle-" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + with: + gradle-home-cache-cleanup: true + cache-read-only: true - name: Validate Gradle Wrapper Integrity uses: gradle/wrapper-validation-action@v2 - - name: Make Gradle wrapper executable - run: chmod +x ./gradlew - - name: Build & Publish + env: + RELEASE_BUILD: true + PLATFORM: ${{ inputs.platform }} + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} + MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} run: ./gradlew numismaticsPublish \ No newline at end of file