Skip to content

fix: Convert MODRINTH_SECRET to env #1

fix: Convert MODRINTH_SECRET to env

fix: Convert MODRINTH_SECRET to env #1

name: Build and Publish to Modrinth
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up SDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- run: chmod +x ./gradlew
- name: Run tests
run: ./gradlew test
build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up SDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- run: chmod +x ./gradlew
- name: Build
run: ./gradlew build
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up SDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- run: chmod +x ./gradlew
- name: Publish on Modrinth
run: ./gradlew modrinth
env:
MODRINTH_SECRET: ${{ secrets.MODRINTH_SECRET }}