Skip to content
Open
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
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ jobs:
node-version: "20.x"
# registry-url is required for releasing packages
registry-url: "https://registry.npmjs.org"

- name: Install latest npm cli
run: npm install -g npm@latest
Comment on lines +20 to +21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As trusted publishing requires npm CLI version >=11.5.1, we manually install the latest version since the default installed npm version is insufficient.

In the latest workflow run we can see that by default the npm cli version 10.8.2 is used, which does not support trusted publishing.


- run: npm ci

- name: Publish package
# --provenance enables the automatic generation of provenance statements
# --provenance enables the automatic generation of provenance statements (when using trusted publisher, this is automatically enabled and therefore optional)
# --access public is only hard required for the initial release, but it doesn't hurt having it setup
# npm version >=11.5.1 required for trusted publisher
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}