Skip to content

Commit

Permalink
Update GH Actions
Browse files Browse the repository at this point in the history
Action versions were bumped to account for Node.js 20, and the custom
caching actions were replaced with Gradle's new setup-gradle action.
  • Loading branch information
sciwhiz12 committed Feb 28, 2024
1 parent 637e68d commit 5c1545c
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,29 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2

build:
name: "Build using Gradle"
needs: validate
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
check-latest: true
- name: Cache ForgeGradle and Librarian caches
uses: actions/cache@v3
- uses: gradle/actions/setup-gradle@v3
with:
path: |
~/.gradle/caches/forge_gradle/**
!~/.gradle/caches/forge_gradle/assets
~/.gradle/caches/parchmentgradle
key: ${{ runner.os }}-gradle-mc-caches-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/*versions.toml') }}
restore-keys: |
${{ runner.os }}-gradle-mc-caches-
- uses: burrunan/gradle-cache-action@v1
with:
arguments: build
# Read-only cache if not on repo's default branch: https://stackoverflow.com/a/68414395
read-only: ${{ format('refs/heads/{0}', github.event.repository.default_branch) != github.ref }}
gradle-dependencies-cache-key: |
gradle/libs.versions.toml
gradle-distribution-sha-256-sum-warning: false
- uses: actions/upload-artifact@v3
cache-read-only: ${{ format('refs/heads/{0}', github.event.repository.default_branch) != github.ref }}
- run: ./gradlew build
- uses: actions/upload-artifact@v4
with:
name: Build artifacts
path: build/libs/*.jar

0 comments on commit 5c1545c

Please sign in to comment.