Skip to main content
Configure MCReleaser to publish your mods, plugins, and resource packs to Modrinth.

Required Variables

MODRINTH_TOKEN
string
required
The Modrinth API token used to authenticate with the Modrinth API.You can generate an API token from your Modrinth account settings under the “API tokens” section. The token needs the UPLOAD_VERSION scope.Example:
export MODRINTH_TOKEN="mrp_xxxxxxxxxxxxxxxxxxxx"
or with system properties:
java -DmodrinthToken="mrp_xxxxxxxxxxxxxxxxxxxx" -jar mcreleaser.jar
MODRINTH_PROJECT
string
required
The Modrinth project ID or slug where the version will be uploaded.You can find your project ID/slug in your project’s settings or URL (e.g., fabric-api from https://modrinth.com/mod/fabric-api).Example:
export MODRINTH_PROJECT="awesome-mod"
or with system properties:
java -DmodrinthProject="awesome-mod" -jar mcreleaser.jar
MODRINTH_GAME_VERSIONS
string
required
Space-separated list of Minecraft versions that this version supports.If not set, MCReleaser will use the common GAME_VERSIONS variable as a fallback.Example:
export MODRINTH_GAME_VERSIONS="1.20.1 1.20.2 1.20.4"
or with system properties:
java -DmodrinthGameVersions="1.20.1 1.20.2 1.20.4" -jar mcreleaser.jar
MODRINTH_LOADERS
string
required
Space-separated list of mod loaders that this version supports.Valid values: fabric, forge, quilt, neoforge, rift, liteloader, modloader, paper, spigot, bukkit, purpur, sponge, bungeecord, waterfall, velocityExample:
export MODRINTH_LOADERS="fabric quilt"
or with system properties:
java -DmodrinthLoaders="fabric quilt" -jar mcreleaser.jar

Optional Variables

MODRINTH_GAME_VERSION_TYPE
string
default:"release"
The type of game version to filter when resolving version IDs from the Minecraft version manifest.If not set, MCReleaser will use the common GAME_VERSION_TYPE variable as a fallback.Valid values: release, snapshot, old_beta, old_alphaExample:
export MODRINTH_GAME_VERSION_TYPE="release"
MODRINTH_VERSION_TYPE
string
default:"release"
The release channel for this version on Modrinth.Valid values:
  • release - Stable, production-ready release
  • beta - Beta testing version
  • alpha - Alpha testing version
Example:
export MODRINTH_VERSION_TYPE="release"
or with system properties:
java -DmodrinthVersionType="beta" -jar mcreleaser.jar
MODRINTH_DEPENDENCIES
string
JSON array of dependencies for this version. Each dependency specifies a relationship to another project.Format:
[
  {
    "project_id": "project-slug",
    "dependency_type": "required"
  }
]
Valid dependency types: required, optional, incompatible, embeddedExample:
export MODRINTH_DEPENDENCIES='[{"project_id":"fabric-api","dependency_type":"required"}]'
Whether to feature this version. Featured versions appear more prominently on the project page.Example:
export MODRINTH_FEATURED=true
or with system properties:
java -DmodrinthFeatured=true -jar mcreleaser.jar
MODRINTH_ENDPOINT
string
default:"production"
The Modrinth API endpoint to use. Set to staging to upload to Modrinth’s staging environment for testing.Valid values:Example:
export MODRINTH_ENDPOINT="staging"
or with system properties:
java -DmodrinthEndpoint="staging" -jar mcreleaser.jar
The staging environment is useful for testing uploads without affecting your production project.

Source Reference

Modrinth properties are defined in:
/workspace/source/modrinth/src/main/java/me/hsgamer/mcreleaser/modrinth/ModrinthPropertyKey.java:7
public interface ModrinthPropertyKey {
    PropertyPrefix MODRINTH = new PropertyPrefix("modrinth");
    PropertyKey TOKEN = MODRINTH.key("token");
    PropertyKey PROJECT = MODRINTH.key("project");
    PropertyKey VERSION_TYPE = MODRINTH.key("versionType");
    PropertyKey GAME_VERSIONS = MODRINTH.key("gameVersions");
    PropertyKey GAME_VERSION_TYPE = MODRINTH.key("gameVersionType");
    PropertyKey FEATURED = MODRINTH.key("featured");
    PropertyKey LOADERS = MODRINTH.key("loaders");
    PropertyKey DEPENDENCIES = MODRINTH.key("dependencies");
    PropertyKey ENDPOINT = MODRINTH.key("endpoint");
}

Complete Example

Using Environment Variables

export NAME="AwesomeMod"
export VERSION="1.2.0"
export DESCRIPTION="Added new features and fixed bugs"
export MODRINTH_TOKEN="mrp_xxxxxxxxxxxxxxxxxxxx"
export MODRINTH_PROJECT="awesome-mod"
export MODRINTH_GAME_VERSIONS="1.20.1 1.20.2 1.20.4"
export MODRINTH_LOADERS="fabric"
export MODRINTH_VERSION_TYPE="release"
export MODRINTH_DEPENDENCIES='[{"project_id":"fabric-api","dependency_type":"required"}]'
export MODRINTH_FEATURED=true

java -jar mcreleaser.jar

Using System Properties

java -Dname="AwesomeMod" \
     -Dversion="1.2.0" \
     -Ddescription="Added new features and fixed bugs" \
     -DmodrinthToken="mrp_xxxxxxxxxxxxxxxxxxxx" \
     -DmodrinthProject="awesome-mod" \
     -DmodrinthGameVersions="1.20.1 1.20.2 1.20.4" \
     -DmodrinthLoaders="fabric" \
     -DmodrinthVersionType="release" \
     -jar mcreleaser.jar

GitHub Actions Workflow

name: Release to Modrinth

on:
  release:
    types: [created]

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Set up JDK
        uses: actions/setup-java@v4
        with:
          java-version: '17'
          distribution: 'temurin'
      
      - name: Build
        run: ./gradlew build
      
      - name: Release to Modrinth
        env:
          NAME: ${{ github.event.repository.name }}
          VERSION: ${{ github.ref_name }}
          DESCRIPTION: ${{ github.event.release.body }}
          MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
          MODRINTH_PROJECT: "awesome-mod"
          MODRINTH_GAME_VERSIONS: "1.20.1 1.20.2 1.20.4"
          MODRINTH_LOADERS: "fabric"
          MODRINTH_VERSION_TYPE: "release"
        run: java -jar mcreleaser.jar

Tips

  • Store your MODRINTH_TOKEN as a secret in your CI/CD system
  • The version name will be taken from the common NAME variable
  • The version changelog will be taken from the common DESCRIPTION variable
  • You can specify multiple loaders separated by spaces to support cross-platform mods
  • Use the common GAME_VERSIONS variable to set versions for all platforms at once
  • Featured versions are highlighted on your project page, but only one version per loader/game version combination should be featured

Build docs developers (and LLMs) love