# Publishing Rivencraft with the Modrinth and CurseForge APIs The local helper is [`scripts/publish_mod_sites.py`](../scripts/publish_mod_sites.py). It previews a release unless `--publish` is explicitly supplied. The current configuration is for the Minecraft **26.3** artifact only. The 1.21.1 line needs its required external dependencies mapped on both sites before API publishing is enabled for it. ## One-time token setup Create a [Modrinth personal access token](https://docs.modrinth.com/api/#authentication) in account settings with `VERSION_CREATE` (upload) and `USER_READ` (read-only credential check) scopes. Create a [CurseForge Upload API token](https://support.curseforge.com/support/solutions/articles/9000197321) from the author's API Tokens page. Treat both as passwords: never put them in git, chat, a release note, or a command-line argument. In a terminal at the repository root, run these one at a time and paste the corresponding token into the hidden prompt: ```sh python3 scripts/publish_mod_sites.py store-token modrinth python3 scripts/publish_mod_sites.py store-token curseforge ``` The tokens are stored in the desktop Secret Service keyring under `application=rivencraft-publishing`, separately by site. The script also accepts `RIVENCRAFT_MODRINTH_TOKEN` or `RIVENCRAFT_CURSEFORGE_TOKEN` environment variables, but these take precedence over keyring entries and should not be put in shell history or startup files. Verify the credentials without uploading anything: ```sh python3 scripts/publish_mod_sites.py check-token modrinth python3 scripts/publish_mod_sites.py check-token curseforge ``` ## Release workflow Build the JAR, write a Markdown changelog, and preview the metadata: ```sh python3 scripts/publish_mod_sites.py release \ --jar ports/mc263/build/libs/rivencraft-26.3-1.0.1.32-beta.1.jar \ --changelog ports/mc263/RELEASE_NOTES_1.0.1.32-beta.1.md \ --version 1.0.1.32-beta.1 \ --name 'Rivencraft 1.0.1.32-beta.1 — NeoForge 26.3' \ --minecraft 26.3 --java 25 --channel beta ``` For a *new* version only, append `--publish` to upload to both sites. Use `--site modrinth` or `--site curseforge` to target one site. Modrinth rejects an existing version number; CurseForge may not, so check its file list before any retry after a partial failure. CurseForge approval may take additional time. The helper uses Modrinth's documented multipart [`POST /version`](https://docs.modrinth.com/api/operations/createversion/) and CurseForge's documented [`POST /api/projects/{projectId}/upload-file`](https://support.curseforge.com/support/solutions/articles/9000197321) with the JAR, changelog, version channel, NeoForge, Minecraft version, Java version, and client/server environment. It sets no external dependencies for 26.3, which uses Rivencraft's first-party Age backend.