Skip to content

ci: publish releases with npm trusted publishing - #785

Merged
thebuilder merged 2 commits into
mainfrom
feat/npm-trusted-publishing-eb39b8
Aug 18, 2026
Merged

ci: publish releases with npm trusted publishing#785
thebuilder merged 2 commits into
mainfrom
feat/npm-trusted-publishing-eb39b8

Conversation

@thebuilder

@thebuilder thebuilder commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Moves releases off my local machine and into GitHub Actions, using npm trusted publishing. The trusted publisher is already configured on npm and bound to release.yml.

How a release works now

Actions tab > Release > Run workflow, on the branch to release:

  • version - the bump: patch, minor, major, or a pre* variant.
  • tag - the npm dist-tag, latest by default. Use beta for prereleases.

The workflow then bumps the version with bumpp, commits and tags vX.Y.Z, pushes, builds, publishes to npm, and creates a GitHub release with generated notes (marked prerelease for pre* bumps).

What changed

  • .github/workflows/release.yml - new manually dispatched release workflow.
    • id-token: write lets npm authenticate over OIDC, so there is no NODE_AUTH_TOKEN and no npm secret in the repo. Provenance is attested automatically.
    • npm is upgraded before publishing, since trusted publishing needs npm ≥ 11.5.1 and Node 24's bundled npm may be older.
    • contents: write covers the version commit/tag push and the GitHub release.
    • The build step also runs the existing attw / publint / size-limit checks through postbuild.
  • Removed the release scripts from the package and the root passthrough. With trusted publishing configured, a local npm publish is rejected anyway, so dropping them avoids a confusing failure.
  • Removed the dead "release" semantic-release config block from the package manifest. No semantic-release dependency was installed and releases were not cut that way.
  • CONTRIBUTING.md - documents the new flow and drops the stale semantic-release reference.

Move releases off the local machine and into GitHub Actions. The new
Release workflow is dispatched manually with a bump type and dist-tag,
then bumps the version, tags it, builds, publishes to npm over OIDC and
creates the GitHub release.

No npm token is needed anywhere, and packages get provenance for free.
The local `release` scripts are removed so nobody publishes from a
laptop by accident, along with the dead semantic-release config block
that no longer matched how releases were cut.
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-intersection-observer Ready Ready Preview Aug 18, 2026 3:17pm
react-intersection-observer-storybook Ready Ready Preview Aug 18, 2026 3:17pm

@pkg-pr-new

pkg-pr-new Bot commented Aug 18, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/react-intersection-observer@785

commit: 524b7c9

`main` is protected and the repository is user-owned, so the GitHub
Actions app cannot be added as a ruleset bypass actor. Mint a short-lived
token from a dedicated GitHub App instead, and use it for the checkout so
bumpp can push the version commit and tag.

GITHUB_TOKEN drops to contents: read, since everything that writes now
goes through the app token.
@thebuilder
thebuilder merged commit 322451a into main Aug 18, 2026
10 checks passed
@thebuilder
thebuilder deleted the feat/npm-trusted-publishing-eb39b8 branch August 18, 2026 15:25
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