Skip to content

Publish on GitHub & Modrinth #2

Publish on GitHub & Modrinth

Publish on GitHub & Modrinth #2

Workflow file for this run

name: Publish on GitHub & Modrinth
on: [ pull_request, workflow_dispatch ]
env:
MODRINTH_TOKEN: ${{ secrets.PUBLISH_MODRINTH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
permissions:
contents: write
jobs:
build:
strategy:
matrix:
java: [
21, # Current Java LTS
]
runs-on: ubuntu-24.04
steps:
- name: Check Environment Variables
run: env
- name: Checkout Repository
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ matrix.java }}
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: Build
run: ./gradlew build
- name: Publish (Modrinth/GitHub)
if: ${{ matrix.java == '21' }}
uses: Kir-Antipov/[email protected]
with:
modrinth-id: 1q2w3e4r
modrinth-token: "${{env.MODRINTH_TOKEN}}"
github-token: "${{env.GITHUB_TOKEN}}"
version-type: release
github-generate-changelog: true
loaders: fabric
java: "${{ matrix.java }}"