Skip to content

chore: enable npm trusted publishing#282

Merged
felipefreitag merged 1 commit intomainfrom
feat/trusted-publishing
Apr 17, 2026
Merged

chore: enable npm trusted publishing#282
felipefreitag merged 1 commit intomainfrom
feat/trusted-publishing

Conversation

@felipefreitag
Copy link
Copy Markdown
Contributor

@felipefreitag felipefreitag commented Apr 17, 2026

Publishes to npm automatically on tag push using GitHub Actions OIDC. The npm dist-tag is derived from the pre-release identifier (e.g. v2.3.0-preview-foo.0 publishes with --tag preview).


Summary by cubic

Add trusted publishing to npm in the release workflow. On tag pushes, we build and publish via OIDC and auto-derive the npm --tag from the version.

  • New Features
    • Adds publish-npm job in .github/workflows/release.yml (skips on workflow_dispatch).
    • Uses GitHub Actions OIDC to publish to npm (no long-lived tokens).
    • Sets --tag latest for tags like vX.Y.Z; for pre-releases, uses the first identifier (e.g., v2.3.0-preview-foo.0 -> preview).
    • Builds with pnpm, verifies with scripts/verify-bundle.mjs, then runs npm publish.

Written for commit 4ec46ae. Summary will update on new commits.

Publishes to npm automatically on tag push using GitHub Actions OIDC,
eliminating the need for long-lived npm tokens. The npm dist-tag is
derived from the pre-release identifier (e.g. v2.3.0-preview-foo.0
publishes with --tag preview).
@felipefreitag felipefreitag changed the title chore: switch back to Depot runners chore: enable npm trusted publishing Apr 17, 2026
else
PRERELEASE="${TAG#v[0-9]*.[0-9]*.[0-9]*-}"
echo "tag=${PRERELEASE%%[-.]*}" >> "$GITHUB_OUTPUT"
fi
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Examples for the logic here:

Git tag npm dist-tag Install command
v2.3.0 latest npm install resend-cli
v2.3.0-preview-automations.0 preview npm install resend-cli@preview
v2.3.0-beta.1 beta npm install resend-cli@beta
v2.3.0-canary.5 canary npm install resend-cli@canary

@felipefreitag felipefreitag marked this pull request as ready for review April 17, 2026 14:55
@felipefreitag felipefreitag merged commit a778742 into main Apr 17, 2026
9 checks passed
@felipefreitag felipefreitag deleted the feat/trusted-publishing branch April 17, 2026 14:58
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.

2 participants