Skip to content

feat: publish the released clients to npm and PyPI (ticket 74, #80) - #332

Open
scrimshawlife-ctrl wants to merge 2 commits into
mainfrom
feat/74-publish-clients
Open

scrimshawlife-ctrl wants to merge 2 commits into
mainfrom
feat/74-publish-clients

Conversation

@scrimshawlife-ctrl

@scrimshawlife-ctrl scrimshawlife-ctrl commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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 its SHA256SUMS, never rebuilt):

  • publish-pypi: the wheel and sdist to PyPI by trusted publishing (OIDC, no stored token), pypa/gh-action-pypi-publish pinned by SHA, skip-existing: true.
  • publish-npm: @zero-state/jchain, then @zero-state/jchain-mcp, with npm publish <tarball> --access public. A version already on npm is skipped (npm view). The first publish uses the NPM_TOKEN environment secret; after that npm uses OIDC.

Both jobs run only on a tag push, in the release environment, with contents: read and id-token: write only. Clients, CLIENTS_VERSION and server.json move to 0.1.4 together (mcpName must be in the published tarball, and 0.1.3 is immutable without it). server.json moves to the current 2025-12-11 registry schema; mcp-publisher validate (v1.8.9) says it is valid. The versions job now also refuses a tag when server.json disagrees.

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)".

  1. npm org zero-state (the scope does not exist on npm today).
  2. PyPI pending publisher: project zero-state-jchain, owner Zero-State-LLC, repository JChain, workflow release-clients.yml, environment release.
  3. GitHub environment release, deployment tags limited to clients-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.
  4. First npm publish: either a short-lived granular NPM_TOKEN as a release environment secret, or Danny publishes the two release tarballs by hand (the job then skips them).

⚠️ After the first successful npm publish (do not forget)

  • Add an npm trusted publisher on each package: Zero-State-LLC / JChain / release-clients.yml / environment release.
  • Delete the NPM_TOKEN environment secret.
  • Set each package's publishing access to "Require two-factor authentication and disallow tokens".

Provenance

npm refuses provenance from a private repository, so while the repo is private the job publishes with --provenance=false and 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 and server.json point 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 push clients-v0.1.4 at 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-run on 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, mcpName net.j-chain/jchain, bundled @zero-state/jchain 0.1.4.
  • Python: twine check --strict passed for zero_state_jchain-0.1.4-py3-none-any.whl and zero_state_jchain-0.1.4.tar.gz.
  • Build-only run of this workflow on the branch (manual dispatch; release and 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 (sha256 0fa135a6… client, efb61de0… MCP); twine check --strict passes on its wheel and sdist. A tag on main rebuilds at the merge commit, so the final hashes are the ones on the clients-v0.1.4 release.

Checks

  • New test/clients-release-publishing.test.ts (6 tests) written first and failing, then passing
  • Root npm test: 812 passed; npm run typecheck; npm run docs:lint 0 issues
  • TypeScript client 77 passed; MCP 40 passed; Python 139 passed, 2 skipped
  • test-guard: CLEAN at 5f51f60 (an earlier || true finding was removed, not waived)
  • No 0.1.3 left in clients/, src/ or test/

The MCP Registry publish stays a manual step (RUNBOOK, "MCP Registry (#80)"): github-oidc login only grants io.github.<org>/*, so publishing net.j-chain/jchain from CI would need the long-lived signing key as a secret.

Agent note (Grok Bot, for Danny). Not merged, not tagged, nothing published.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T09:17:38.334860Z 442bcdb PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread docs/RUNBOOK.md
Then log in and publish:

```sh
mcp-publisher login dns --domain j-chain.net

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant