Skip to content

ci: publish @riskkernel/sdk to npm on release - #106

Merged
prashar32 merged 1 commit into
mainfrom
ci/ts-sdk-npm-publish
Jun 12, 2026
Merged

ci: publish @riskkernel/sdk to npm on release#106
prashar32 merged 1 commit into
mainfrom
ci/ts-sdk-npm-publish

Conversation

@prashar32

Copy link
Copy Markdown
Owner

Wires up npm publishing for the TypeScript SDK so the install becomes the ordinary npm install @riskkernel/sdk instead of a git URL or file: path — the npm analog of the PyPI Trusted Publishing pipeline.

How it works

  • Trigger: every v* tag (same as the Python publish + release workflows).
  • Auth: npm Trusted Publishing (OIDC) — no npm token stored anywhere. The job runs with id-token: write, publishes with --provenance, and a recent npm exchanges the GitHub OIDC token for a short-lived credential.
  • Safe: a guard step fails loudly if package.json version ≠ the tag; typecheck + tests run before publish so a broken build never ships; the publish is idempotent (skips a version already on npm), so a re-run or re-tag is safe.

One-time setup (documented in the workflow header)

npm can't attach a trusted publisher to a name that doesn't exist yet, so the very first publish is a manual npm publish --access public to claim @riskkernel/sdk; after that, add the GitHub Actions trusted publisher on npm and every tagged release is tokenless. (On the org transfer, re-point the publisher — the npm analog of moving the PyPI one.)

Notes

Closes #82.

Add a tag-triggered workflow that publishes the TypeScript SDK to npm, so the
install becomes the ordinary `npm install @riskkernel/sdk` instead of a git URL
or file: path — the npm analog of the PyPI Trusted Publishing pipeline.

Auth is npm Trusted Publishing (OIDC): no npm token is stored. The job runs with
id-token: write, publishes with provenance, and a recent npm exchanges the GitHub
OIDC token for a short-lived credential. A guard step fails loudly if the package
version doesn't match the tag, the suite runs before publish so a broken build is
never shipped, and the publish is idempotent (skips a version already on npm) so
a re-run or re-tag is safe. One-time npm trusted-publisher setup is documented in
the workflow header.
@prashar32
prashar32 merged commit 857f3c6 into main Jun 12, 2026
5 checks passed
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.

Publish @riskkernel/sdk to npm on release

1 participant