A versatile GitHub Action to streamline the publication of Minecraft projects.
Supports mods, plugins, resource packs, and more, across various platforms such as Modrinth, GitHub Releases, and CurseForge. Features automatic value resolution and minimal configuration requirements for effortless setup and use.
The following verbose example is for illustrative purposes only and is not recommended for regular use. `mc-publish` was designed to require minimal configuration, so there's no need for all of these settings.
Overly complex configurations with hardcoded values that could be resolved automatically not only complicate your workflow but can also introduce errors. For example, attempting to use `github-discussion: Announcements` in a repository that doesn't have a "Announcements" discussion category or discussions in general would lead to problems.
As a rule of thumb, if you don't see a clear reason to use an input, it's best not to include it.
| [modrinth-id](#modrinth-id) | The unique identifier of your Modrinth project. | A value specified in the metadata file. | `AANobbMI` |
| [modrinth-featured](#modrinth-featured) | Set to `true` to feature the version on Modrinth. | `true` | `true`<br>`false` |
| [modrinth-unfeature-mode](#modrinth-unfeature-mode) | Sets the behavior for unfeaturing older Modrinth versions. | If `modrinth-featured` is set to `true`, `subset`; otherwise, `none`. | `none`<br>`subset`<br>`intersection`<br>`any` |
| [modrinth-token](#modrinth-token) | Your Modrinth API token. | - | `${{ secrets.MODRINTH_TOKEN }}` |
| [curseforge-id](#curseforge-id) | The unique identifier of your CurseForge project. | A value specified in the metadata file. | `394468` |
| [curseforge-token](#curseforge-token) | Your CurseForge API token. | - | `${{ secrets.CURSEFORGE_TOKEN }}` |
| [github-tag](#github-tag) | The tag name for the release where assets will be uploaded. | If a release triggered the action, its tag is used. Otherwise, inferred from `GITHUB_REF`. | `mc1.17.1-0.3.2` |
| [github-generate-changelog](#github-generate-changelog) | Set to `true` to generate a changelog automatically for this release. Ignored if the GitHub Release already exists. | `true`, if `changelog` and `changelog-file` are not provided; otherwise, `false`. | `true`<br>`false` |
| [github-draft](#github-draft) | Set to `true` to create a draft release. Ignored if the GitHub Release already exists. | `false` | `true`<br>`false` |
| [github-prerelease](#github-prerelease) | Set to `true` to mark the release as a prerelease. Ignored if the GitHub Release already exists. | `false`, if `version-type` is `release`; otherwise, `true`. | `true`<br>`false` |
| [github-commitish](#github-commitish) | Defines the commitish value that determines where the Git tag is created from. Ignored if the Git tag already exists. | The repository's default branch. | `dev`<br>`feature/86` |
| [github-discussion](#github-discussion) | If specified, creates and links a discussion of the specified **EXISTING** category to the release. Ignored if the GitHub Release already exists. | - | `Announcements` |
| [github-token](#github-token) | Your GitHub API token. | - | `${{ secrets.GITHUB_TOKEN }}` |
| [files](#files) | An array of [globs](https://www.digitalocean.com/community/tools/glob) determining which files to upload. | `build/libs/!(*-@(dev\|sources\|javadoc)).jar`<br>`build/libs/*-@(dev\|sources\|javadoc).jar` | `build/libs/*.jar` |
| [name](#name) | The name of the version. | A title of the release that triggered the action. | `Sodium 0.3.2 for Minecraft 1.17.1` |
| [version](#version) | The version number. | A tag of the release that triggered the action. | `mc1.17.1-0.3.2` |
| [version-type](#version-type) | The version type. | Will be parsed from the `version` value. | `alpha`<br>`beta`<br>`release` |
| [changelog](#changelog) | The changelog for this version. | A body of the release that triggered the action. | `This release fixes a few more issues in Sodium 0.3 for Minecraft 1.17.1.` |
| [changelog-file](#changelog-file) | A [glob](https://www.digitalocean.com/community/tools/glob) pointing to the changelog file. | - | `CHANGELOG.md` |
| [loaders](#loaders) | An array of supported loaders. | A value specified in the metadata file. | `fabric`<br>`forge`<br>`quilt`<br>`rift` |
| [game-versions](#game-versions) | An array of supported Minecraft versions. | A value specified in the metadata file. | `21w37a`<br>`>=1.17`<br>`[1.17,)` |
| [dependencies](#dependencies) | An array of dependencies required by your project. | A value specified in the metadata file. | `fabric@0.40.0(required)` |
| [game-version-filter](#game-version-filter) | Controls the method used to filter game versions. | `releases \| min-major \| min-minor` | `releases`<br>`min`<br>`max`<br>`none` |
| [java](#java) | An array of Java versions compatible with your project. | - | `Java 8`<br>`Java 1.8`<br>`8` |
| [retry-attempts](#retry-attempts) | Defines the maximum number of asset publishing attempts. | `2` | `2`<br>`10`<br>`-1` |
| [retry-delay](#retry-delay) | Specifies the delay (in milliseconds) between asset publishing attempts. | `10000` | `1000`<br>`60000`<br>`0` |
| [fail-mode](#fail-mode) | Controls how the action responds to errors during the mod publishing process. | `fail` | `fail`<br>`warn`<br>`skip` |
Please note that any top-level property *(`name`, `version`, `dependencies`, `files`, etc.)* can be used as a target-specific one. This allows you to customize `mc-publish` to better meet your individual preferences and requirements. To illustrate, let's take a look at the following configuration:
Sets the behavior for unfeaturing older Modrinth versions. Default value is `subset`, if [`modrinth-featured`](#modrinth-featured) is set to `true`; otherwise, `none`.
-`none` - no Modrinth versions will be unfeatured.
-`subset` - only those Modrinth versions which are considered a subset of the new one *(i.e., new release supports all of the version's mod loaders **and** game versions)* will be unfeatured.
-`intersection` - only those Modrinth versions which intersects with the new one *(i.e., support at least one of the mod loaders and one of the game versions supported by the new release)* will be unfeatured.
-`any` - all Modrinth versions will be unfeatured.
If none of the given presets suits your needs, you can construct a new one from the following values via bitwise `OR`, like so - `game-version-intersection | loaders-subset`:
Set to `true` to generate a changelog automatically for this release; `false` otherwise. Ignored if the GitHub Release already exists. Default value is `true`, if `changelog` and `changelog-file` are not provided; otherwise, `false`.
Set to `true` to mark the release as a prerelease; `false` otherwise. Ignored if the GitHub Release already exists. Default value is `false`, if [`version-type`](version-type) is `release`; otherwise, `true`.
Defines the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Ignored if the Git tag already exists. Default value is the repository's default branch.
The name of the version. Defaults to a title of the release that triggered the action. If you want Modrinth and CurseForge to determine the version name themselves, omit the field with an empty string (`""`).
The version type - alpha, beta, or release. By default, it will be parsed from the [`version`](#version) value. If no value is provided, it will be parsed from the [`version`](#version) value (e.g., `0.40.0+1.17-alpha` results in `alpha`).
An array of supported mod loaders. By default, it will be automatically determined from your project's metadata file (e.g., `fabric.mod.json`, `mods.toml`, `quilt.mod.json`, etc.).
An array of supported Minecraft versions. By default, `mc-publish` will look for `minecraft` dependency in your project's metadata file (e.g., `fabric.mod.json`, `mods.toml`, `quilt.mod.json`, etc.).
The format for dependencies can be described as follows: `id@version(type){platform:alias}#(ignore:ignored-platform)`. Each component of this format, with the exception of the `id`, is optional.
-`fail` - immediately sets the action status to **failed** and terminates its execution.
-`warn` - warns about errors. The action won't be terminated, nor its status will be set to **failed**.
-`skip` - warns about errors. The action won't be terminated, but its status will be set to **failed** after all specified targets have been processed.
| [modrinth-id](#modrinth-id-1) | The unique identifier of your Modrinth project. | `"AANobbMI"` |
| [modrinth-version](#modrinth-version) | The unique identifier of the version published on Modrinth by this action. | `"Fz37KqRh"` |
| [modrinth-url](#modrinth-url) | The URL directing to the newly published version on Modrinth. | `"https://modrinth.com/mod/sodium/version/mc1.17.1-0.3.4"` |
| [modrinth-files](#modrinth-files) | Array of objects, each containing details about the files published for the new version on Modrinth. | `"[]"` |
| [curseforge-id](#curseforge-id-1) | The unique identifier of your CurseForge project. | `"394468"` |
| [curseforge-version](#curseforge-version) | The unique identifier of the version published on CurseForge by this action. | `"3488820"` |
| [curseforge-url](#curseforge-url) | The URL directing to the newly published version on CurseForge. | `https://www.curseforge.com/api/v1/mods/394468/files/3488820/download` |
| [curseforge-files](#curseforge-files) | Array of objects, each containing details about the files published for the new version on CurseForge. | `"[]"` |
| [github-repo](#github-repo) | The full repository name on GitHub, formatted as 'username/repository'. | `"CaffeineMC/sodium-fabric"` |
| [github-tag](#github-tag-1) | The Git tag associated with the new or updated release published on GitHub. | `"mc1.17.1-0.3.4"` |
| [github-url](#github-url) | The URL directing to the newly published version on GitHub. | `"https://github.com/CaffeineMC/sodium-fabric/releases/tag/mc1.17.1-0.3.4"` |
| [github-files](#github-files) | Array of objects, each containing details about the files published for the new version on GitHub. | `"[]"` |
#### modrinth-id
The unique identifier of your Modrinth project.
```json
"AANobbMI"
```
#### modrinth-version
The unique identifier of the version published on Modrinth by this action.
```json
"Fz37KqRh"
```
#### modrinth-url
The URL directing to the newly published version on Modrinth.