Skip to content

ci: staged npm publishing with OIDC trusted publishing - #10

Merged
v1rtl merged 1 commit into
masterfrom
ci/trusted-publishing
Oct 26, 2026
Merged

v1rtl merged 1 commit into
masterfrom
ci/trusted-publishing

Conversation

@v1rtl

@v1rtl v1rtl commented Oct 26, 2026

Copy link
Copy Markdown
Member

Summary

Adds .github/workflows/publish.yml, modelled on ensdomains/address-encoder:

  • Triggered when a GitHub release is published.
  • id-token: write lets the job authenticate to npm via OIDC trusted publishing, so no NPM_TOKEN secret is needed.
  • pnpm/setup@v3 installs pnpm 12 + Node 24 and does a frozen install; then lint, typecheck, test and build run before publishing.
  • pnpm stage publish uploads the version as staged: it doesn't go live until a maintainer approves it on npmjs.com with 2FA.
  • Prereleases go to the next dist-tag, normal releases to latest.
  • --no-git-checks is needed because release builds check out the tag (detached HEAD).

Verified locally with pnpm stage publish --dry-run; the tarball contains only dist/index.js, dist/index.d.ts, LICENSE, README.md and package.json.

Required before the first release

On npmjs.com, under @tinyhttp/vary → Settings → Trusted publishing, add a GitHub Actions publisher:

  • Organization/user: tinyhttp
  • Repository: vary
  • Workflow filename: publish.yml

Generated by Claude Code

@v1rtl
v1rtl merged commit e04db6f into master Oct 26, 2026
3 checks passed
@v1rtl
v1rtl deleted the ci/trusted-publishing branch October 26, 2026 12:57
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