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
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v7

# Trusted publishing needs npm >= 11.5.1; Node 24 bundles it.
# npm stage publish needs npm >= 11.15.0; current Node 24 bundles it.
- uses: actions/setup-node@v7
with:
node-version: '24.x'
Expand All @@ -26,7 +26,7 @@ jobs:
- run: npm ci
- run: npm run test
- run: npm run build
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
# A maintainer approves the staged version (RELEASE.MD). npm logs
# trusted-publishing errors only at verbose level.
- run: npm stage publish --access=public --loglevel=verbose

7 changes: 3 additions & 4 deletions RELEASE.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ This document describes the release process for the `deepinfra` package.
Before release, make sure to do the following steps:

- [ ] Update the `package.json` version number. You can use `npm version --allow-same-version --no-git-tag-version version_number` to update the version number.
- [ ] Create a new release on GitHub with the same version number. This runs `.github/workflows/deploy.yml`, which publishes to npm.
- [ ] Create a new release on GitHub with the same version number. This runs `.github/workflows/deploy.yml`, which stages the version on npm.
- [ ] Have a package maintainer approve the staged version with 2FA, on npmjs.com under Staged Packages or with `npm stage list deepinfra` and `npm stage approve <stage-id>`. Until then it can't be installed.

## npm authentication
The publish job signs in to npm with [trusted publishing](https://docs.npmjs.com/trusted-publishers). On npmjs.com, open the package's Settings, then Trusted publishing, and add GitHub Actions with organization `deepinfra`, repository `deepinfra-node` and workflow filename `deploy.yml`, with `npm publish` allowed. A new entry expires unless it publishes within 2 days, so add it right before a release.

Without a trusted publisher the job falls back to the `NPM_TOKEN` repository secret.
The publish job signs in to npm with [trusted publishing](https://docs.npmjs.com/trusted-publishers) and only [stages](https://docs.npmjs.com/staged-publishing) the version. The trusted publisher is on npmjs.com under the package's Settings, then Trusted publishing: GitHub Actions with organization `deepinfra`, repository `deepinfra-node` and workflow filename `deploy.yml`, with `npm publish` unticked under Allowed actions, so nothing goes live without a maintainer's approval. If it ever has to be recreated, do it right before a release: a new entry expires unless a release uses it within 2 days.



Expand Down
Loading