Skip to content

Commit c4a40ea

Browse files
authored
Add npm trusted publisher workflow (#197)
1 parent 03b9a7a commit c4a40ea

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
id-token: write
10+
contents: write
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
- uses: actions/setup-node@v6
18+
with:
19+
node-version: '24'
20+
registry-url: 'https://registry.npmjs.org'
21+
- run: npm ci
22+
- run: npm run build
23+
- run: npm test
24+
- run: npm publish --provenance --access public
25+
- uses: softprops/action-gh-release@v2
26+
with:
27+
generate_release_notes: true

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
"pretest": "npm run build",
3535
"test": "jest",
3636
"version": "echo \"export const Version = '$npm_package_version'\" > src/version.ts && git add src/version.ts && npm run build",
37-
"prepublishOnly": "npm run build",
38-
"postpublish": "npm publish --ignore-scripts --@planetscale:registry='https://npm.pkg.github.com'"
37+
"prepublishOnly": "npm run build"
3938
},
4039
"repository": {
4140
"type": "git",

0 commit comments

Comments
 (0)