Repository navigation
feat: publish the released clients to npm and PyPI (ticket 74, #80) - #332
scrimshawlife-ctrl wants to merge 2 commits into
Conversation
A clients-v* tag now also publishes the files already on the GitHub release, checked against SHA256SUMS: the Python wheel and sdist to PyPI by trusted publishing, and @zero-state/jchain then @zero-state/jchain-mcp to npm. Both jobs run in the release environment with contents: read and id-token: write, and skip a version the registry already has. Clients, CLIENTS_VERSION and server.json move to 0.1.4; server.json moves to the 2025-12-11 registry schema. Docs: TICKETS, NEXT, RUNBOOK.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 442bcdb235
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Then log in and publish: | ||
|
|
||
| ```sh | ||
| mcp-publisher login dns --domain j-chain.net |
There was a problem hiding this comment.
Supply the generated private key to the registry login
On a machine following this runbook from scratch, the preceding steps create key.pem but never supply its private key to this command or set MCP_PRIVATE_KEY, so DNS authentication cannot complete and the registry publish remains blocked. The v1.8.9 CLI reference specifies --private-key=HEX_KEY and requires an “Ed25519 private key (64-character hex)”; it also documents extracting that value from the PEM. Add that extraction and explicitly pass the value or export it through MCP_PRIVATE_KEY, rather than implying the CLI automatically discovers the PEM file.
Useful? React with 👍 / 👎.
Summary
Ticket 74 (#80). A
clients-v*tag still builds and attaches the clients to an immutable GitHub release exactly as before. After that, two new jobs publish those same release files (downloaded from the release, checked against itsSHA256SUMS, never rebuilt):publish-pypi: the wheel and sdist to PyPI by trusted publishing (OIDC, no stored token),pypa/gh-action-pypi-publishpinned by SHA,skip-existing: true.publish-npm:@zero-state/jchain, then@zero-state/jchain-mcp, withnpm publish <tarball> --access public. A version already on npm is skipped (npm view). The first publish uses theNPM_TOKENenvironment secret; after that npm uses OIDC.Both jobs run only on a tag push, in the
releaseenvironment, withcontents: readandid-token: writeonly. Clients,CLIENTS_VERSIONandserver.jsonmove to 0.1.4 together (mcpNamemust be in the published tarball, and 0.1.3 is immutable without it).server.jsonmoves to the current2025-12-11registry schema;mcp-publisher validate(v1.8.9) says it is valid. Theversionsjob now also refuses a tag whenserver.jsondisagrees.The site wording ("not on npm or PyPI yet") is unchanged. It changes in its own ticket after the packages are verified live.
Before the first publish (Danny)
Nothing here works until these exist. Full steps are in
docs/RUNBOOK.md, "First publish and trusted publishing (#80)".zero-state(the scope does not exist on npm today).zero-state-jchain, ownerZero-State-LLC, repositoryJChain, workflowrelease-clients.yml, environmentrelease.release, deployment tags limited toclients-v*. Create it before pushing a tag: GitHub otherwise creates it on first use with no rules. Required reviewers are not available on private repositories on the Team plan, so the tag rule plus the existing "Client release tags" ruleset are the gate.NPM_TOKENas areleaseenvironment secret, or Danny publishes the two release tarballs by hand (the job then skips them).Zero-State-LLC/JChain/release-clients.yml/ environmentrelease.NPM_TOKENenvironment secret.Provenance
npm refuses provenance from a private repository, so while the repo is private the job publishes with
--provenance=falseand emits a warning; PyPI attestations are off for the same reason (they go to the public Sigstore log). Both turn on automatically once the repository is public. The package metadata andserver.jsonpoint at this private repository as the source, so users following those links get a 404 until it is public.Merge order
This PR changes
CLIENTS_VERSION, which the Worker uses to link the release, and merging deploys production. As with #245: merge, let the deploy finish, then pushclients-v0.1.4at the merge commit. Until the tag exists, the pages link a release that answers 404. Merge needs Danny's yes.Dry run (local, nothing published)
npm publish --dry-runon the tarballs built the way the workflow builds them:@zero-state/[email protected]27 files, 44.1 kB;@zero-state/[email protected]44 files (17 own plus the bundled client), 59.9 kB,mcpNamenet.j-chain/jchain, bundled@zero-state/jchain0.1.4.twine check --strictpassed forzero_state_jchain-0.1.4-py3-none-any.whlandzero_state_jchain-0.1.4.tar.gz.releaseand both publish jobs skipped as designed): https://github.com/Zero-State-LLC/JChain/actions/runs/44710310859. Its npm tarballs are byte-identical to the locally dry-run ones (sha2560fa135a6…client,efb61de0…MCP);twine check --strictpasses on its wheel and sdist. A tag onmainrebuilds at the merge commit, so the final hashes are the ones on theclients-v0.1.4release.Checks
test/clients-release-publishing.test.ts(6 tests) written first and failing, then passingnpm test: 812 passed;npm run typecheck;npm run docs:lint0 issues5f51f60(an earlier|| truefinding was removed, not waived)0.1.3left inclients/,src/ortest/The MCP Registry publish stays a manual step (RUNBOOK, "MCP Registry (#80)"):
github-oidclogin only grantsio.github.<org>/*, so publishingnet.j-chain/jchainfrom CI would need the long-lived signing key as a secret.Agent note (Grok Bot, for Danny). Not merged, not tagged, nothing published.