{"id":13543510,"url":"https://github.com/cloudnode-pro/modrinth-publish","last_synced_at":"2025-04-18T22:11:13.865Z","repository":{"id":217026065,"uuid":"742798618","full_name":"cloudnode-pro/modrinth-publish","owner":"cloudnode-pro","description":"A GitHub Action for publishing plugin versions to Modrinth","archived":false,"fork":false,"pushed_at":"2024-11-11T22:10:18.000Z","size":1275,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-11T23:19:35.053Z","etag":null,"topics":["modrinth","modrinth-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudnode-pro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-13T12:01:32.000Z","updated_at":"2024-11-11T22:09:16.000Z","dependencies_parsed_at":"2024-01-19T06:00:13.709Z","dependency_job_id":"db3be35a-25d7-4f7b-9b8e-a1597101fe6a","html_url":"https://github.com/cloudnode-pro/modrinth-publish","commit_stats":null,"previous_names":["cloudnode-pro/modrinth-publish"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudnode-pro%2Fmodrinth-publish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudnode-pro%2Fmodrinth-publish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudnode-pro%2Fmodrinth-publish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudnode-pro%2Fmodrinth-publish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudnode-pro","download_url":"https://codeload.github.com/cloudnode-pro/modrinth-publish/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226971307,"owners_count":17711414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["modrinth","modrinth-api"],"created_at":"2024-08-01T11:00:32.452Z","updated_at":"2025-04-18T22:11:13.839Z","avatar_url":"https://github.com/cloudnode-pro.png","language":"TypeScript","funding_links":[],"categories":["Project/version management tools"],"sub_categories":["In-game"],"readme":"# modrinth-publish\n\nPublish a version on Modrinth. Works for all Modrinth project types.\n\n## Usage\n\n```yaml\n# …\nsteps:\n  - uses: cloudnode-pro/modrinth-publish@v2\n    with:\n      token: ${{ secrets.MODRINTH_TOKEN }}\n      # … configure the action using inputs here\n```\n\n## Inputs\n\n### ~~`api-domain`~~ (deprecated)\n\nThe Modrinth API domain.\n\n\u003e [!WARNING]\n\u003e The Modrinth Staging API is no longer recommended for testing or as a sandbox. Instead, consider creating a ‘draft’\n\u003e project on the production API and deleting it after testing.\n\u003e This input is scheduled for removal in `v3.0.0`.\n\n\u003cdl\u003e\n    \u003cdt\u003eDefault\u003c/dt\u003e\n    \u003cdd\u003e\u003ccode\u003eapi.modrinth.com\u003c/code\u003e\u003c/dd\u003e\n\u003c/dl\u003e\n\n***\n\n### `token` (required)\n\nModrinth API token. The token must have the ‘Create versions’ scope. This token is secret, and it’s recommended to set\nit inside\na [GitHub Repository Secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions).\n\nPersonal access tokens (PATs) can be generated from [the user settings](https://modrinth.com/settings/pats).\n\n***\n\n### `project` (required)\n\nThe ID of the project this version is for.\n\nYou can obtain the ID by opening your project on Modrinth, then opening the \u003ckbd\u003e⋮\u003c/kbd\u003e menu, and selecting \u003ckbd\u003eCopy\nID\u003c/kbd\u003e.\n\n***\n\n### `name`\n\nThe name of this version.\n\n\u003cdl\u003e\n    \u003cdt\u003eDefault\u003c/dt\u003e\n    \u003cdd\u003ecopied from \u003ccode\u003eversion\u003c/code\u003e\u003c/dd\u003e\n\u003c/dl\u003e\n\n***\n\n### `version` (required)\n\nThe version number. Ideally will follow [semantic versioning](https://semver.org/).\n\n***\n\n### `channel`\n\nThe release channel for this version.\n\n\u003cdl\u003e\n    \u003cdt\u003eAllowed values\u003c/dt\u003e\n    \u003cdd\u003e\u003ccode\u003erelease\u003c/code\u003e, \u003ccode\u003ebeta\u003c/code\u003e, \u003ccode\u003ealpha\u003c/code\u003e\u003c/dd\u003e\n    \u003cdt\u003eDefault\u003c/dt\u003e\n    \u003cdd\u003eInferred from the version.\n    \u003cul\u003e\n        \u003cli\u003eIf version includes \u003ccode\u003ealpha\u003c/code\u003e, will be set to \u003ccode\u003ealpha\u003c/code\u003e.\u003c/li\u003e\n        \u003cli\u003eIf version includes \u003ccode\u003ebeta\u003c/code\u003e, \u003ccode\u003erc\u003c/code\u003e, or \u003ccode\u003epre\u003c/code\u003e, will be set to \u003ccode\u003ebeta\u003c/code\u003e.\u003c/li\u003e\n        \u003cli\u003eOtherwise, will be set to \u003ccode\u003erelease\u003c/code\u003e.\u003c/li\u003e\n    \u003c/ul\u003e\n    \u003c/dd\u003e\n\u003c/dl\u003e\n\n***\n\n### `featured`\n\nWhether the version is featured or not.\n\n\u003cdl\u003e\n    \u003cdt\u003eAllowed values\u003c/dt\u003e\n    \u003cdd\u003e\u003ccode\u003etrue\u003c/code\u003e, \u003ccode\u003efalse\u003c/code\u003e\u003c/dd\u003e\n    \u003cdt\u003eDefault\u003c/dt\u003e\n    \u003cdd\u003e\u003ccode\u003etrue\u003c/code\u003e if the release channel is \u003ccode\u003erelease\u003c/code\u003e, otherwise \u003ccode\u003efalse\u003c/code\u003e.\u003c/dd\u003e\n\u003c/dl\u003e\n\n***\n\n### `changelog`\n\nThe changelog for this version.\n\n***\n\n### `loaders` (required)\n\nThe mod loaders that this version supports. In case of resource packs, use `minecraft`.\n\nFormat each loader on a new line, or use a JSON string array.\n\n\u003cdl\u003e\n    \u003cdt\u003eExample\u003c/dt\u003e\n    \u003cdd\u003e\n\n```yaml\nloaders: |-\n  paper\n  fabric\n```\n\n```yaml\nloaders: '[\"paper\", \"fabric\"]'\n```\n\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n***\n\n### `game-versions`\n\nA list of versions of Minecraft that this version supports. You can use a pattern like `1.21.x` to include all patch\nversions (the last number in the version).\n\nFormat each version on a new line, or use a JSON string array.\n\n\u003cdl\u003e\n    \u003cdt\u003eExample\u003c/dt\u003e\n    \u003cdd\u003e\n\n```yaml\ngame-versions: |-\n  1.21.x\n  1.20.x\n  1.19.4\n```\n\n```yaml\ngame-versions: '[\"1.21.x\", \"1.20.x\", \"1.19.4\"]'\n```\n\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n***\n\n### `files` (required)\n\nA list of file paths to upload. There must be at least one file, unless the new version’s status is `draft`. The allowed\nfile extensions are `.mrpack`, `.jar`, `.zip`, and `.litemod`.\n\nFormat each file on a new line, or use a JSON string array.\n\n\u003cdl\u003e\n    \u003cdt\u003eExample\u003c/dt\u003e\n    \u003cdd\u003e\n\n```yaml\nfiles: |-\n  target/YourProject-1.2.3.jar\n  path/to/file.zip\n```\n\n```yaml\nfiles: '[\"target/YourProject-1.2.3.jar\", \"path/to/file.zip\"]'\n```\n\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n***\n\n### `primary-file`\n\nThe name (not path) from `files` to be set as the primary file.\n\n\u003cdl\u003e\n    \u003cdt\u003eExample\u003c/dt\u003e\n    \u003cdd\u003e\u003ccode\u003eYourProject-1.2.3.jar\u003c/code\u003e\u003c/dd\u003e\n\u003c/dl\u003e\n\n***\n\n### `dependencies`\n\nA list of specific versions of projects that this version depends on.\n\nFormatted as JSON array.\nSee [Create Version - Modrinth API docs](https://docs.modrinth.com/api/operations/createversion/#request-body).\n\n\u003cdl\u003e\n    \u003cdt\u003eExample\u003c/dt\u003e\n    \u003cdd\u003e\n\n```yaml\ndependencies: |-\n  [{\n      \"project_id\": \"AABBCCDD\",\n      \"dependency_type\": \"optional\"\n  }]\n```\n\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n***\n\n### `status`\n\n\u003cdl\u003e\n    \u003cdt\u003eAllowed values\u003c/dt\u003e\n    \u003cdd\u003e\u003ccode\u003elisted\u003c/code\u003e, \u003ccode\u003earchived\u003c/code\u003e, \u003ccode\u003edraft\u003c/code\u003e, \u003ccode\u003eunlisted\u003c/code\u003e, \u003ccode\u003escheduled\u003c/code\u003e, \u003ccode\u003eunknown\u003c/code\u003e\u003c/dd\u003e\n    \u003cdt\u003eDefault\u003c/dt\u003e\n    \u003cdd\u003e\u003ccode\u003elisted\u003c/code\u003e\u003c/dd\u003e\n\u003c/dl\u003e\n\n***\n\n### `requested-status`\n\n\u003cdl\u003e\n    \u003cdt\u003eAllowed values\u003c/dt\u003e\n    \u003cdd\u003e\u003ccode\u003elisted\u003c/code\u003e, \u003ccode\u003earchived\u003c/code\u003e, \u003ccode\u003edraft\u003c/code\u003e, \u003ccode\u003eunlisted\u003c/code\u003e\u003c/dd\u003e\n\u003c/dl\u003e\n\n***\n\n## Example Maven workflow\n\nYou can use the following example workflow to publish a version on Modrinth by creating a release on GitHub.\n\nThis example workflow will let you automatically build and upload a version on Modrinth whenever you publish a new\nrelease via GitHub. This enables you to choose the version tag and write release notes via the GitHub interface.\n\nAs the version will be taken from the release tag, in your `pom.xml` you can set a version like `0.0.0-SNAPSHOT` and it\nwill always be replaced with the correct version for builds via the workflow. This means you won‘t need to update the\nversion in multiple places.\n\n\u003cdetails name=\"example-workflow\" open\u003e\n\u003csummary\u003eMaven\u003c/summary\u003e\n\n```yaml\nname: Publish\n\non:\n  release:\n    types: [published]\n\njobs:\n  publish:\n    name: Publish\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n\n      # !!! Make sure to select the correct Java version for your project !!!\n      - name: Set up JDK 17\n        uses: actions/setup-java@v4\n        with:\n          java-version: 17\n          distribution: temurin\n          cache: maven\n\n      # This step will take the version tag from the release and replace it in `pom.xml` before building.\n      - name: Set version from release tag\n        run: mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false\n\n      - name: Build and package with Maven\n        run: mvn -B clean package --file pom.xml\n\n      - name: Upload to Modrinth\n        uses: cloudnode-pro/modrinth-publish@v2\n        with:\n          # Configure the action as needed. The following is an example.\n          token: ${{ secrets.MODRINTH_TOKEN }}\n          project: AABBCCDD\n          name: ${{ github.event.release.name }}\n          version: ${{ github.event.release.tag_name }}\n          changelog: ${{ github.event.release.body }}\n          loaders: |-\n            paper\n            spigot\n            bukkit\n          game-versions: |-\n            1.20.x\n            1.21.x\n          files: target/YourProject-${{ github.event.release.tag_name }}.jar\n```\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudnode-pro%2Fmodrinth-publish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudnode-pro%2Fmodrinth-publish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudnode-pro%2Fmodrinth-publish/lists"}