Merge pull request #3 from TropheusJ/fabric-26.1 #29
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: | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| attestations: write | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: JDK Setup | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 25 | |
| distribution: 'temurin' | |
| - name: Gradle Setup | |
| # note: setup-gradle v6+ has switched to a proprietary license. | |
| # pin this to v5 for the foreseeable future. | |
| # https://blog.gradle.org/github-actions-for-gradle-v6 | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| validate-wrappers: true | |
| - name: Enable gradlew execution | |
| run: chmod +x ./gradlew | |
| - name: Gradle Build | |
| run: ./gradlew build | |
| - name: Attest Build Provenance | |
| if: github.event_name != 'pull_request' | |
| uses: actions/attest@v4 | |
| with: | |
| subject-path: 'build/libs/*.jar' | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Artifacts | |
| path: build/libs/*.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/upload-release-assets@v3.0 | |
| with: | |
| files: 'build/libs/*.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 publishMods |