Skip to content

Publish the mod

Publish the mod #9

Workflow file for this run

name: Publish the mod
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
env:
DISABLE_PROPERTIES_UPDATE: true
with:
arguments: build
- name: Upload to Modrinth
uses: gradle/gradle-build-action@v2
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
VERSION_NAME: ${{ github.event.release.name }}
with:
arguments: modrinth
- name: Upload to GitHub
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/libs/*.jar
tag: ${{ github.ref }}
overwrite: true
file_glob: true