[npm] Add automated NPM publish path#893
Open
gregnazario wants to merge 1 commit into
Open
Conversation
To remove usage of tokens, it runs everything through github
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow to publish the SDK package to npm on GitHub Release publish events, aiming to use GitHub OIDC trusted publishing (no long-lived npm tokens) and add basic safety checks around version/tag correctness.
Changes:
- Added a
release.publishedworkflow that validates the release tag format and enforcespackage.jsonversion === tag. - Builds the package with pnpm and publishes to npm with provenance enabled.
- Adds an npm upgrade step intended to work around an npm OIDC trusted publishing issue for scoped packages.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+21
to
+22
| if ! echo "$TAG" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$'; then | ||
| echo "::error::Release tag '$TAG' does not match pattern vMAJOR.MINOR.PATCH[-prerelease]" |
| # npm (https://github.com/npm/cli/issues/8678). Without this, publishing a | ||
| # scoped package via trusted publishing fails with E404. | ||
| - name: Upgrade npm for OIDC trusted publishing | ||
| run: npm install -g npm@latest |
| run: npm install -g npm@latest | ||
|
|
||
| - name: Publish to npm with provenance | ||
| run: npm publish --provenance --access public |
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.
To remove usage of tokens, it runs everything through github
Description
Test Plan
Related Links
Checklist
pnpm fmt?CHANGELOG.md?