2024-04-27 07:29:49 +02:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on: [ pull_request, push ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
java: [
|
2024-04-27 08:54:38 +02:00
|
|
|
17 # Current Java LTS & minimum supported by Minecraft
|
2024-04-27 07:29:49 +02:00
|
|
|
]
|
2024-04-27 09:07:04 +02:00
|
|
|
os: [ ubuntu-latest ]
|
2024-04-27 07:29:49 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-05-12 07:17:52 +02:00
|
|
|
uses: actions/checkout@v4
|
2024-04-27 07:29:49 +02:00
|
|
|
- name: Validate Gradle Wrapper
|
2024-05-12 08:12:22 +02:00
|
|
|
uses: gradle/actions/wrapper-validation@v3
|
2024-04-27 07:29:49 +02:00
|
|
|
- name: Gradle Cache
|
2024-05-12 07:17:52 +02:00
|
|
|
uses: actions/cache@v4
|
2024-04-27 07:29:49 +02:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
.gradle/loom-cache
|
|
|
|
build/
|
|
|
|
key: ${{ runner.os }}-jdk${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties', '**/gradle-wrapper.properties', '.github/workflows/build.yml') }}
|
|
|
|
- name: Setup JDK ${{ matrix.java }}
|
2024-05-12 07:17:52 +02:00
|
|
|
uses: actions/setup-java@v4
|
2024-04-27 07:29:49 +02:00
|
|
|
with:
|
2024-05-12 07:17:52 +02:00
|
|
|
distribution: 'temurin'
|
2024-04-27 07:29:49 +02:00
|
|
|
java-version: ${{ matrix.java }}
|
|
|
|
- name: Make Gradle Wrapper Executable
|
|
|
|
if: ${{ runner.os != 'Windows' }}
|
|
|
|
run: chmod +x ./gradlew
|
|
|
|
- name: Build
|
2024-04-27 08:27:33 +02:00
|
|
|
# doesn't actually publish, as no secrets are passed in, just makes sure that publishing works
|
|
|
|
run: ./gradlew publish --no-daemon
|
2024-04-27 07:29:49 +02:00
|
|
|
- name: Capture Build Artifacts
|
|
|
|
if: ${{ runner.os == 'Linux' && matrix.java == '17' }}
|
2024-05-12 07:17:52 +02:00
|
|
|
uses: actions/upload-artifact@v4
|
2024-04-27 07:29:49 +02:00
|
|
|
with:
|
|
|
|
name: Artifacts
|
2024-05-12 07:35:38 +02:00
|
|
|
path: |
|
|
|
|
common/build/libs/
|
|
|
|
fabric/build/libs/
|
|
|
|
forge/build/libs/
|