Skip to content
Merged
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
17 changes: 6 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: publish

# Stages the version of a pushed version tag on npm through npm's trusted
# publishing: npm trusts this workflow, so no tokens are needed. A maintainer
# then approves the staged version with 2FA on npmjs.com or with
# `npm stage approve`, which makes it installable. The dist-tag comes from
# `publishConfig.tag` of the tagged commit: `latest` for releases, `next` for
# prereleases.
# Publishes the version of a pushed version tag to npm through npm's trusted
# publishing: npm trusts this workflow, so no tokens are needed. The dist-tag
# comes from `publishConfig.tag` of the tagged commit: `latest` for releases,
# `next` for prereleases.
on:
push:
tags: ['v*']
Expand All @@ -23,16 +21,13 @@ jobs:
steps:
- uses: actions/checkout@v7

# Trusted publishing needs npm 11.5.1 or later, which comes with Node 24.
- uses: actions/setup-node@v7
with:
node-version: 24.x
registry-url: https://registry.npmjs.org

# Staged publishing needs npm 11.15.0 or later.
- run: npm install -g npm@^11.15.0

# `npm stage publish` isn't documented to read `publishConfig`, so pass its tag:
- run: npm stage publish --tag "$(node -p "require('./package.json').publishConfig.tag")"
- run: npm publish

# Creates the GitHub release with the version's section of the changelog as
# its notes. Only versions on the `latest` dist-tag become the latest release.
Expand Down
Loading