Publish to Modrinth with Node instead of Python #16

Merged
selimaj-dev merged 1 commits from modrinth-node into master 2026-09-25 17:18:13 +00:00
Owner

Problem

The first "Publish to Modrinth" run failed in actions/setup-python:

Error: The version '3.12' with architecture 'x64' was not found for this operating system.

setup-python can only install Python on GitHub's Ubuntu runner images, and this runner's job image isn't one of them.

Change

  • The publisher is ported from Python to a dependency-free Node script, .gitea/scripts/publish_modrinth.mjs, using the built-in fetch, FormData and Blob. Every Gitea runner has Node, because it runs JavaScript actions like actions/checkout. This runner's Node is 21+, judging by the punycode deprecation warning in the log.
  • The "Set up Python" step is removed, and the workflow runs node .gitea/scripts/publish_modrinth.mjs.
  • publish_modrinth.py is removed.

Behaviour is unchanged: the same checks (release exists, versions match the tag, game versions known to Modrinth), the same skipping of versions already on Modrinth, the same public download URLs, and the same dry_run mode.

Testing

  • Local dry run against the real 0.1.1-beta release, with Node 22: identical to the Python version. It would publish 0.1.1-beta+1.21.4 … +1.21.11 as beta, and all download URLs are reachable.
  • A missing token and an unknown tag give readable errors and exit 1.
  • The workflow YAML parses.
  • Still not tested: the actual POST /v2/version upload. Run 0.1.1-beta with dry_run first, then without.

🤖 Generated with Claude Code

## Problem The first "Publish to Modrinth" run failed in `actions/setup-python`: ``` Error: The version '3.12' with architecture 'x64' was not found for this operating system. ``` `setup-python` can only install Python on GitHub's Ubuntu runner images, and this runner's job image isn't one of them. ## Change - The publisher is ported from Python to a **dependency-free Node script**, `.gitea/scripts/publish_modrinth.mjs`, using the built-in `fetch`, `FormData` and `Blob`. Every Gitea runner has Node, because it runs JavaScript actions like `actions/checkout`. This runner's Node is 21+, judging by the `punycode` deprecation warning in the log. - The "Set up Python" step is removed, and the workflow runs `node .gitea/scripts/publish_modrinth.mjs`. - `publish_modrinth.py` is removed. Behaviour is unchanged: the same checks (release exists, versions match the tag, game versions known to Modrinth), the same skipping of versions already on Modrinth, the same public download URLs, and the same `dry_run` mode. ## Testing - Local dry run against the real `0.1.1-beta` release, with Node 22: identical to the Python version. It would publish `0.1.1-beta+1.21.4` … `+1.21.11` as `beta`, and all download URLs are reachable. - A missing token and an unknown tag give readable errors and exit 1. - The workflow YAML parses. - **Still not tested:** the actual `POST /v2/version` upload. Run `0.1.1-beta` with `dry_run` first, then without. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
selimaj-dev added 1 commit 2026-09-25 17:17:47 +00:00
actions/setup-python can only install Python on GitHub's Ubuntu images,
so it fails on this runner's job image ("version 3.12 ... was not found
for this operating system"). Every Gitea runner has Node, since it runs
JavaScript actions, so port the publisher to a dependency-free Node
script (fetch/FormData/Blob) and drop the setup step. Behaviour is
unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
selimaj-dev merged commit 91b53daac9 into master 2026-09-25 17:18:13 +00:00
selimaj-dev deleted branch modrinth-node 2026-09-25 17:18:15 +00:00
Sign in to join this conversation.