ci: publish @riskkernel/sdk to npm on release - #106
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wires up npm publishing for the TypeScript SDK so the install becomes the ordinary
npm install @riskkernel/sdkinstead of a git URL orfile:path — the npm analog of the PyPI Trusted Publishing pipeline.How it works
v*tag (same as the Python publish + release workflows).id-token: write, publishes with--provenance, and a recent npm exchanges the GitHub OIDC token for a short-lived credential.package.jsonversion ≠ 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 publicto 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
sdks/typescript/package.jsonto match the tag (alongside the Python SDK) — the guard enforces it.Closes #82.