Skip to content

Commit f66aeb7

Browse files
xrendanclaude
andcommitted
Match npm trusted publishers docs exactly
- Move permissions to workflow level - Use npm ci instead of bun install - Remove --provenance flag (auto-detected) - Use working-directory instead of cd - Use actions/checkout@v4 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0760065 commit f66aeb7

File tree

1 file changed

+18
-46
lines changed

1 file changed

+18
-46
lines changed

.github/workflows/npm-publish.yml

Lines changed: 18 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -20,76 +20,48 @@ on:
2020
- charts
2121
- colours
2222

23+
permissions:
24+
id-token: write
25+
contents: read
26+
2327
env:
2428
DRY_RUN: ${{ github.event.inputs.dry-run == 'true' && '--dry-run' || '' }}
2529

2630
jobs:
2731
publish-charts:
2832
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'charts' || github.event_name == 'release'
2933
runs-on: ubuntu-latest
30-
permissions:
31-
contents: read
32-
id-token: write
3334
steps:
34-
- name: Checkout repository
35-
uses: actions/checkout@v5
36-
37-
- name: Setup Bun
38-
uses: oven-sh/setup-bun@v2
39-
with:
40-
bun-version: latest
35+
- uses: actions/checkout@v4
4136

42-
- name: Setup Node.js
43-
uses: actions/setup-node@v4
37+
- uses: actions/setup-node@v4
4438
with:
4539
node-version: "22"
4640
registry-url: "https://registry.npmjs.org"
4741

48-
- name: Install dependencies
49-
run: bun install --frozen-lockfile
50-
51-
- name: Run tests
52-
run: bun run test
42+
- run: npm ci
5343

54-
- name: Verify charts package can be packed
55-
run: cd packages/charts && npm pack --dry-run
44+
- run: npm test
45+
working-directory: packages/charts
5646

57-
- name: Publish @buildcanada/charts
58-
run: cd packages/charts && npm publish --access public --provenance ${{ env.DRY_RUN }}
59-
env:
60-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
- run: npm publish --access public ${{ env.DRY_RUN }}
48+
working-directory: packages/charts
6149

6250
publish-colours:
6351
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'colours' || github.event_name == 'release'
6452
runs-on: ubuntu-latest
65-
permissions:
66-
contents: read
67-
id-token: write
6853
steps:
69-
- name: Checkout repository
70-
uses: actions/checkout@v5
54+
- uses: actions/checkout@v4
7155

72-
- name: Setup Bun
73-
uses: oven-sh/setup-bun@v2
74-
with:
75-
bun-version: latest
76-
77-
- name: Setup Node.js
78-
uses: actions/setup-node@v4
56+
- uses: actions/setup-node@v4
7957
with:
8058
node-version: "22"
8159
registry-url: "https://registry.npmjs.org"
8260

83-
- name: Install dependencies
84-
run: bun install --frozen-lockfile
85-
86-
- name: Build colours package
87-
run: cd packages/colours && bun run build
61+
- run: npm ci
8862

89-
- name: Verify colours package can be packed
90-
run: cd packages/colours && npm pack --dry-run
63+
- run: npm run build
64+
working-directory: packages/colours
9165

92-
- name: Publish @buildcanada/colours
93-
run: cd packages/colours && npm publish --access public --provenance ${{ env.DRY_RUN }}
94-
env:
95-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
66+
- run: npm publish --access public ${{ env.DRY_RUN }}
67+
working-directory: packages/colours

0 commit comments

Comments
 (0)