Overview
The GitHub platform integration allows you to automatically publish your Minecraft artifacts to GitHub Releases. This is useful for distributing your plugins, mods, or other artifacts directly through your GitHub repository. MCReleaser will create a new release with the specified tag, or update an existing release if it already exists. All files in your artifact bundle will be uploaded as release assets.Required Credentials
To publish to GitHub, you need:- GitHub Token: A personal access token or GitHub Actions token with
contents: writepermission - Repository: The full repository name in the format
owner/repo - Git Ref: The tag reference to create the release for (e.g.,
refs/tags/v1.0.0)
When using GitHub Actions, the
GITHUB_TOKEN is automatically available and the repository and ref are set via default environment variables.Configuration Options
The GitHub token to authenticate API requests. This must have
contents: write permission to create releases and upload assets.In GitHub Actions, use the built-in GITHUB_TOKEN secret:The full repository name in
owner/repository format.Example: HSGamer/BetterEconomyIn GitHub Actions, this is automatically set to ${{ github.repository }}.The Git reference to create the release for. Typically a tag reference like
refs/tags/v1.0.0.MCReleaser will automatically extract the version from the tag (removing the refs/tags/ prefix).In GitHub Actions, this is automatically set to ${{ github.ref }}.Whether to create the release as a draft. Draft releases are not visible to the public until published.Set to
true to create a draft release:Whether to mark the release as a pre-release. Pre-releases are typically used for beta or alpha versions.Set to
true to mark as pre-release:Implementation Details
The GitHub platform implementation performs the following steps:- Authentication: Creates a GitHub API client using the provided OAuth token
- Repository Access: Retrieves the specified repository
- Release Creation: Checks if a release with the specified tag exists:
- If it exists, uses the existing release
- If not, creates a new release with the specified draft/prerelease settings
- Asset Upload: Uploads all files from the artifact bundle as release assets
If the release already exists, MCReleaser will not update its properties (draft, prerelease, description). It will only upload new assets.
Complete Example
Source Code Reference
The GitHub platform implementation can be found in:- Platform logic:
github/src/main/java/me/hsgamer/mcreleaser/github/GithubPlatform.java - Configuration keys:
github/src/main/java/me/hsgamer/mcreleaser/github/GithubPropertyKey.java