Skip to content

Publish to CurseForge & Modrinth #4

Publish to CurseForge & Modrinth

Publish to CurseForge & Modrinth #4

Workflow file for this run

name: Publish to CurseForge & Modrinth
on:
release:
types: [published]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-24.04
steps:
- name: Checkout Master Repository
uses: actions/checkout@v4
with:
ref: master
- name: Get Mod Info
id: mod_info
run: |
VERSION=$(grep "mod_version" gradle.properties | cut -d'=' -f2)
MC_VERSION=$(grep "minecraft_version" gradle.properties | cut -d'=' -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "mc_version=$MC_VERSION" >> $GITHUB_OUTPUT
- name: Download Artifacts from Build branch
uses: actions/checkout@v4
with:
ref: build
path: build-artifacts
- name: Publish to CurseForge + Modrinth
uses: tristankechlo/publish-mc-mod@v2.0.0
with:
mc-version: ${{ steps.mod_info.outputs.mc_version }}
mod-version: ${{ steps.mod_info.outputs.version }}
curseforge-id: ${{ secrets.CURSEFORGE_PROJECT_ID }}
modrinth-id: ${{ secrets.MODRINTH_PROJECT_ID }}
version-range: ${{ steps.mod_info.outputs.mc_version }}
version-type: "release"
loaders: "fabric"
fabric-glob: "build-artifacts/stackabletools-${{ steps.mod_info.outputs.version }}.jar"
changelog: "Official release of v${{ steps.mod_info.outputs.version }}"
curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }}
modrinth-token: ${{ secrets.MODRINTH_API_TOKEN }}