Initialize fabric-1.21 #2
This file contains hidden or 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: | |
| release: | |
| types: | |
| - published | |
| push: | |
| branches: | |
| - '**' | |
| tags-ignore: | |
| - '**' | |
| pull_request: | |
| permissions: | |
| id-token: write | |
| attestations: write | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: JDK Setup | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| - name: Gradle Setup | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| validate-wrappers: true | |
| - name: Enable gradlew execution | |
| run: chmod +x ./gradlew | |
| - name: Gradle Build | |
| run: ./gradlew build | |
| - name: Attest Build Provenance | |
| uses: actions/attest-build-provenance@v2 | |
| with: | |
| subject-path: 'build/libs/*.jar, !build/libs/*-sources.jar' | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Artifacts | |
| path: | | |
| build/libs/*.jar | |
| !build/libs/*-sources.jar | |
| - name: Maven Publish | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| run: ./gradlew publish | |
| - name: Github Publish | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| uses: AButler/[email protected] | |
| with: | |
| files: 'build/libs/*.jar;!build/libs/*-sources.jar' | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Modrinth Publish | |
| env: | |
| MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | |
| CHANGELOG: ${{ github.event.release.body }} | |
| if: ${{ github.event_name == 'release' && github.event.action == 'published' && env.MODRINTH_TOKEN != '' }} | |
| run: | | |
| ./gradlew --no-configuration-cache modrinth | |
| ./gradlew --no-configuration-cache modrinthSyncBody |