Update build workflow to use gradle build action #61
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: [ "main", "develop" ] | |
pull_request: | |
branches: [ "main", "develop" ] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
strategy: | |
matrix: | |
# Use these Java versions | |
java: [ | |
17, # Current Java LTS & minimum supported by Minecraft | |
] | |
# and run on Linux | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
- name: setup jdk ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'temurin' | |
- name: setup gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
dependency-graph: ${{ github.ref == 'refs/heads/develop' && 'generate-and-submit' || 'generate-and-upload' }} | |
- name: gradle clean build | |
run: ./gradlew clean build | |
# - name: Capture Fabric Artifacts | |
# if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: Fabric Artifacts | |
# path: fabric/build/libs | |
# - name: Capture Forge Artifacts | |
# if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: Forge Artifacts | |
# path: forge/build/libs |