From 30dce0ea7c1f00b1b9c45af9b8cf73e92722008b Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Mon, 29 Jan 2024 01:18:04 +0100 Subject: [PATCH] Change to newer gradle caching --- .github/workflows/build.yml | 29 +++++++++++++---------------- .github/workflows/release.yml | 12 ++++++++++-- gradle.properties | 3 +++ 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2ea00c..eed8dca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,29 +8,26 @@ on: [pull_request, push] jobs: build: - strategy: - matrix: - # Use these Java versions - java: [ - 17, # Current Java LTS & minimum supported by Minecraft - ] - # and run on both Linux and Windows - os: [ubuntu-20.04, windows-2022] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: checkout repository uses: actions/checkout@v2 - - name: validate gradle wrapper - uses: gradle/wrapper-validation-action@v1 - - name: setup jdk ${{ matrix.java }} - uses: actions/setup-java@v1 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'microsoft' + java-version: '17' + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 with: - java-version: ${{ matrix.java }} + cache-read-only: ${{ github.ref != 'refs/heads/main' }} + - name: build run: ./gradlew build - name: capture build artifacts - if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS uses: actions/upload-artifact@v2 with: name: Artifacts - path: build/libs/ \ No newline at end of file + path: build/libs/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bfb12cc..e29c08a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,18 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Set up JDK 17 - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 + with: + distribution: 'microsoft' + java-version: '17' + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 with: - java-version: 17 + cache-read-only: ${{ github.ref != 'refs/heads/main' }} + - name: Build with Gradle env: MOD_VERSION: ${{ github.event.release.tag_name }} diff --git a/gradle.properties b/gradle.properties index a4a3929..45773e0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,6 +7,9 @@ org.gradle.jvmargs=-Xmx1G \ --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED +org.gradle.caching=true +org.gradle.parallel=true + minecraft_version=1.20.4 # Mod Properties