Skip to content

Commit 4656322

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 3725f10 commit 4656322

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,24 @@ jobs:
1212
name: push
1313
runs-on: ubuntu-latest
1414

15+
permissions:
16+
contents: read
17+
# https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions
18+
id-token: write
19+
1520
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-node@v2
21+
- uses: actions/checkout@v6
22+
- run: corepack enable
23+
- uses: actions/setup-node@v6
1824
with:
19-
node-version: 16.x
25+
node-version: 22.x
2026
registry-url: https://registry.npmjs.org
27+
cache: yarn
2128

22-
- run: yarn install --frozen-lockfile
29+
- run: yarn install --immutable
2330
- run: yarn run lint:ci
2431

32+
- run: yarn pack
2533
- name: Publish to NPM
2634
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
27-
run: yarn publish --access public
28-
env:
29-
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
35+
run: npx npm@latest publish package.tgz --provenance --access public

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// -*- jsonc -*-
22
{
33
"editor.codeActionsOnSave": {
4-
"source.fixAll.eslint": true
4+
"source.fixAll.eslint": "explicit"
55
},
66
"editor.formatOnSave": true,
77
"editor.defaultFormatter": "esbenp.prettier-vscode",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"repository": {
88
"type": "git",
9-
"url": "https://github.com/foxglove/just-fetch.git"
9+
"url": "git+https://github.com/foxglove/just-fetch.git"
1010
},
1111
"author": {
1212
"name": "Foxglove",

0 commit comments

Comments
 (0)