Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,25 @@ jobs:
node scripts/dogfood-smoke-test.mjs

- name: Publish to npm with provenance
# OIDC trusted publishing — pnpm delegates to npm CLI, which exchanges
# `--ignore-scripts`: npm runs `prepublishOnly` on publish, and this job
# already ran it as its own step. Without the flag it runs twice — and the
# second run starts with `clean`, deleting and rebuilding the `dist/` that
# `size` and `check:exports` just validated, so the tarball shipped is not
# the artifact the gates checked. Observed in the nest-realtime 1.0.1 run.
#
# `npm publish`, not `pnpm publish`: the registry's `readme` field is
# populated from the publish request, and pnpm 11 does not send it. Every
# package here published under pnpm 11 landed with an empty `readme` — the
# npm page rendering no documentation at all — while every one published
# under pnpm 10, which delegated to the npm CLI, carries it. Confirmed on
# nest-realtime@1.0.1, where switching restored both `readme` and
# `_npmVersion` in a single release.
#
# OIDC trusted publishing still authenticates: the npm CLI exchanges
# the GitHub OIDC token (`id-token: write` above) for a short-lived
# publish credential. `--no-git-checks` is required because the CI
# runner checks out a detached HEAD at the tag SHA.
run: pnpm publish --provenance --no-git-checks
# publish credential. npm runs no git checks, so the detached HEAD the
# runner sits on at the tag SHA needs no flag of its own.
run: npm publish --provenance --access public --ignore-scripts

- name: Extract release notes from CHANGELOG
# Pulls the section for the current tag out of CHANGELOG.md so the
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"mutation:incremental": "stryker run --incremental",
"prepare": "husky",
"prepublishOnly": "pnpm clean && pnpm typecheck && pnpm test:types && pnpm lint && pnpm test:cov:all && pnpm build && pnpm check:published",
"release": "pnpm publish --provenance",
"release": "npm publish --provenance --access public",
"size": "node scripts/check-size.mjs",
"test": "jest",
"test:all": "pnpm test && pnpm test:e2e",
Expand Down
Loading