Skip to content

Commit 65a126a

Browse files
authored
ci: switch to trusted publishing (#113)
1 parent 5e2a3ab commit 65a126a

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/publish-on-npm.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@ jobs:
2121
- uses: actions/setup-node@v4
2222
with:
2323
node-version-file: '.nvmrc'
24+
registry-url: 'https://registry.npmjs.org'
2425
cache: 'npm'
2526
- run: npm ci --legacy-peer-deps
2627
- run: npx semantic-release
2728
env:
28-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Publish to npm (Trusted Publishing)
32+
run: npm publish --provenance --access public
33+
env:
34+
NODE_AUTH_TOKEN: ${{ env.NODE_AUTH_TOKEN }}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@
100100
"plugins": [
101101
"@semantic-release/commit-analyzer",
102102
"@semantic-release/release-notes-generator",
103-
"@semantic-release/npm"
103+
["@semantic-release/npm", {
104+
"npmPublish": false
105+
}],
106+
"@semantic-release/github"
104107
]
105108
}
106109
}

0 commit comments

Comments
 (0)