Skip to content

Add modrinth publishing (#2) #1

Add modrinth publishing (#2)

Add modrinth publishing (#2) #1

name: Publish to Modrinth
on:
push:
branches:
- main
jobs:
build:
environment: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Build with Gradle
run: ./gradlew --build-cache build
- name: Test with Gradle
run: ./gradlew test
- name: Publish release to Modrinth
if: github.ref_name == 'main'
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
MODRINTH_CHANNEL: release
run: ./gradlew modrinth
- name: Publish dev to Modrinth
if: github.ref_name == 'dev'
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
MODRINTH_CHANNEL: development
run: ./gradlew modrinth