57 lines
1.4 KiB
YAML
57 lines
1.4 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
environment: modrinth
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 25
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: "25"
|
|
distribution: "temurin"
|
|
|
|
- name: Set up Gradle
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
- name: Build all Stonecutter targets
|
|
run: ./gradlew chiseledBuild --no-daemon --stacktrace
|
|
|
|
- name: Collect remapped jars (per Minecraft version)
|
|
run: |
|
|
mkdir -p staging
|
|
find versions -path '*/build/libs/*.jar' \
|
|
! -name '*-sources.jar' \
|
|
! -name '*-dev.jar' \
|
|
-exec cp -v {} staging/ \;
|
|
if [ -z "$(ls -A staging 2>/dev/null)" ]; then
|
|
echo "No jars found under versions/*/build/libs/"
|
|
exit 1
|
|
fi
|
|
(cd staging && md5sum *.jar) | tee md5sum.txt
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: jars
|
|
path: |
|
|
staging/*.jar
|
|
md5sum.txt
|
|
|
|
- name: Release (GitHub tags only)
|
|
uses: softprops/action-gh-release@v2
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: |
|
|
staging/*.jar
|
|
md5sum.txt
|