@@ -10,10 +10,10 @@ jobs:
1010 if : contains(github.event.head_commit.message, '[patch]') || contains(github.event.head_commit.message, '[minor]') || contains(github.event.head_commit.message, '[major]')
1111 runs-on : ubuntu-latest
1212
13- # Required permissions for npm provenance
13+ # Required permissions for npm trusted publishing with provenance
1414 permissions :
1515 contents : write # For creating tags and releases
16- id-token : write # Required for npm provenance attestation
16+ id-token : write # Required for OIDC authentication ( npm trusted publishers)
1717
1818 steps :
1919 - name : Checkout code
@@ -28,13 +28,17 @@ jobs:
2828 with :
2929 bun-version : latest
3030
31- # Setup Node.js for npm publish with provenance
31+ # Setup Node.js for npm publish with trusted publishers
3232 - name : Setup Node.js
3333 uses : actions/setup-node@v4
3434 with :
3535 node-version : ' 20'
3636 registry-url : ' https://registry.npmjs.org'
3737
38+ # Upgrade npm to 11.5.1+ (required for trusted publishers)
39+ - name : Upgrade npm for trusted publishing
40+ run : npm install -g npm@latest
41+
3842 - name : Install dependencies with Bun
3943 run : bun install
4044
@@ -88,11 +92,10 @@ jobs:
8892 - name : Build package with Bun
8993 run : bun run package
9094
91- # Use npm for publishing with provenance (Bun doesn't support --provenance yet)
95+ # Use npm for publishing with trusted publishers (OIDC - no token needed)
96+ # Provenance is automatically generated with trusted publishing
9297 - name : Publish to npm with provenance
9398 run : npm publish --provenance --access public
94- env :
95- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
9699
97100 - name : Create git tag
98101 run : |
0 commit comments