Merge pull request #542 from ah-OOG-ah/master #1188
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
# This workflow will build a Java project with Gradle | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Java CI with Gradle | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Ubuntu dependencies | |
run: | | |
sudo apt-get update -y | |
- name: Checkout mod repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Validate gradle wrapper checksum | |
uses: gradle/wrapper-validation-action@v2 | |
- name: Set up JDK versions | |
uses: actions/setup-java@v4 | |
with: | |
java-version: | | |
8 | |
21 | |
17 | |
distribution: 'zulu' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Setup the workspace | |
run: ./gradlew --build-cache --info --stacktrace ${{ inputs.workspace }} | |
- name: Compile the mod | |
run: ./gradlew --build-cache --info --stacktrace assemble | |
- name: Attach user artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.repository_id }}-build-libs | |
path: | | |
build/libs/ | |
!build/libs/*-api.jar | |
!build/libs/*-dev.jar | |
!build/libs/*-dev-preshadow.jar | |
!build/libs/*-sources.jar | |
retention-days: 90 | |
- name: Attach dev artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.repository_id }}-build-dev-libs | |
path: | | |
build/libs/*-api.jar | |
build/libs/*-dev.jar | |
build/libs/*-dev-preshadow.jar | |
build/libs/*-sources.jar | |
retention-days: 90 | |
- name: Attach gradle reports | |
if: failure() && steps.build_mod.conclusion == 'failure' | |
uses: actions/upload-artifact@v4 | |
continue-on-error: true | |
with: | |
name: ${{ github.repository_id }}-reports | |
path: build/reports/ | |
retention-days: 31 |