Skip to content

Commit 3286fd9

Browse files
committed
Use npm trusted publishing for package releases
- Add OIDC permissions (id-token: write, contents: read) for trusted publishing - Replace NODE_AUTH_TOKEN with npx npm@latest publish --provenance
1 parent 6fa125b commit 3286fd9

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
permissions:
16+
contents: read
1617
# https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions
1718
id-token: write
1819

1920
steps:
20-
- uses: actions/checkout@v4.2.2
21+
- uses: actions/checkout@v6
2122
- run: corepack enable
22-
- uses: actions/setup-node@v4.1.0
23+
- uses: actions/setup-node@v6
2324
with:
2425
node-version: 22.x
2526
registry-url: https://registry.npmjs.org
@@ -33,7 +34,4 @@ jobs:
3334
- run: yarn pack
3435
- name: Publish to NPM
3536
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
36-
# `yarn npm publish` does not currently support --provenance: https://github.com/yarnpkg/berry/issues/5430
37-
run: npm publish package.tgz --provenance --access public
38-
env:
39-
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
37+
run: npx npm@latest publish package.tgz --provenance --access public

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,4 @@ dist
110110
!.yarn/plugins
111111
!.yarn/sdks
112112
*.tgz
113+
.DS_Store

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "MIT",
66
"repository": {
77
"type": "git",
8-
"url": "https://github.com/foxglove/message-definition.git"
8+
"url": "git+https://github.com/foxglove/message-definition.git"
99
},
1010
"keywords": [
1111
"schema",

0 commit comments

Comments
 (0)