build & deploy #2
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 & deploy | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: [forge, neoforge, fabric] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Build artifacts | |
run: | | |
if [ ${{ matrix.platform }} == "neoforge" ]; then | |
./gradlew clean neoforge:build | |
elif [ ${{ matrix.platform }} == "forge" ]; then | |
./gradlew clean forge:build | |
elif [ ${{ matrix.platform }} == "fabric" ]; then | |
./gradlew clean fabric:build | |
fi | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifacts-${{ matrix.platform }} | |
path: ${{ matrix.platform }}/build/libs | |
- name: Deploy to CurseForge, Modrinth, or GitHub Releases | |
if: matrix.platform == 'forge' || matrix.platform == 'neoforge' || matrix.platform == 'fabric' | |
uses: Kir-Antipov/mc-publish@v3.3 | |
with: | |
curseforge-id: world-stripper | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
modrinth-id: world-stripper | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
changelog: ${{ steps.get-changelog.outputs.changelog }} | |
name: "" | |
loaders: ${{ matrix.platform }} | |
game-versions: "1.20.4" | |
release-type: release |