Skip to main content
Configure MCReleaser to publish your Paper, Velocity, and Waterfall plugins to Hangar.

Required Variables

HANGAR_KEY
string
required
The Hangar API key used to authenticate with the Hangar API.You can generate an API key from your Hangar settings under the “API Keys” section.Example:
export HANGAR_KEY="your-hangar-api-key"
or with system properties:
java -DhangarKey="your-hangar-api-key" -jar mcreleaser.jar
HANGAR_PROJECT
string
required
The Hangar project slug where the version will be uploaded.You can find your project slug in your project’s URL (e.g., EssentialsX from https://hangar.papermc.io/EssentialsX/EssentialsX).Example:
export HANGAR_PROJECT="AwesomePlugin"
or with system properties:
java -DhangarProject="AwesomePlugin" -jar mcreleaser.jar
HANGAR_CHANNEL
string
required
The release channel for this version on Hangar.Channels allow you to organize versions by stability level. Common channels include: Release, Beta, Alpha, Snapshot.Example:
export HANGAR_CHANNEL="Release"
or with system properties:
java -DhangarChannel="Release" -jar mcreleaser.jar
HANGAR_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 HANGAR_GAME_VERSIONS="1.20.1 1.20.2 1.20.4"
or with system properties:
java -DhangarGameVersions="1.20.1 1.20.2 1.20.4" -jar mcreleaser.jar

Optional Variables

HANGAR_PLATFORM
string
default:"Release"
The platform(s) that this version supports.Valid values: PAPER, WATERFALL, VELOCITYYou can specify multiple platforms separated by spaces.Example:
export HANGAR_PLATFORM="PAPER VELOCITY"
or with system properties:
java -DhangarPlatform="PAPER" -jar mcreleaser.jar
HANGAR_DEPENDENCIES
string
The dependencies of the artifact. This should be formatted according to Hangar’s API requirements.Dependencies define relationships between your plugin and other plugins on Hangar.Example:
export HANGAR_DEPENDENCIES='[{"name":"Vault","required":true}]'

Source Reference

Hangar properties are defined in:
/workspace/source/hangar/src/main/java/me/hsgamer/mcreleaser/hangar/HangarPropertyKey.java:7
public interface HangarPropertyKey {
    PropertyPrefix HANGAR = new PropertyPrefix("hangar");
    PropertyKey KEY = HANGAR.key("key");
    PropertyKey PROJECT = HANGAR.key("project");
    PropertyKey CHANNEL = HANGAR.key("channel");
    PropertyKey PLATFORM = HANGAR.key("platform");
    PropertyKey GAME_VERSIONS = HANGAR.key("gameVersions");
    PropertyKey DEPENDENCIES = HANGAR.key("dependencies");
}

Complete Example

Using Environment Variables

export NAME="AwesomePlugin"
export VERSION="2.5.0"
export DESCRIPTION="Bug fixes and performance improvements"
export HANGAR_KEY="your-hangar-api-key"
export HANGAR_PROJECT="AwesomePlugin"
export HANGAR_CHANNEL="Release"
export HANGAR_GAME_VERSIONS="1.20.1 1.20.2 1.20.4"
export HANGAR_PLATFORM="PAPER"

java -jar mcreleaser.jar

Using System Properties

java -Dname="AwesomePlugin" \
     -Dversion="2.5.0" \
     -Ddescription="Bug fixes and performance improvements" \
     -DhangarKey="your-hangar-api-key" \
     -DhangarProject="AwesomePlugin" \
     -DhangarChannel="Release" \
     -DhangarGameVersions="1.20.1 1.20.2 1.20.4" \
     -DhangarPlatform="PAPER" \
     -jar mcreleaser.jar

GitHub Actions Workflow

name: Release to Hangar

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 Hangar
        env:
          NAME: ${{ github.event.repository.name }}
          VERSION: ${{ github.ref_name }}
          DESCRIPTION: ${{ github.event.release.body }}
          HANGAR_KEY: ${{ secrets.HANGAR_KEY }}
          HANGAR_PROJECT: "AwesomePlugin"
          HANGAR_CHANNEL: "Release"
          HANGAR_GAME_VERSIONS: "1.20.1 1.20.2 1.20.4"
          HANGAR_PLATFORM: "PAPER"
        run: java -jar mcreleaser.jar

Tips

  • Store your HANGAR_KEY as a secret in your CI/CD system
  • Use the Release channel for stable, production-ready versions
  • Use Beta or Alpha channels for testing versions
  • The version name and changelog will be taken from the common NAME and DESCRIPTION variables
  • You can use the common GAME_VERSIONS variable to set versions for all platforms at once
  • If your plugin supports multiple platforms (Paper, Velocity, Waterfall), list them all in HANGAR_PLATFORM

Build docs developers (and LLMs) love