Skip to content

Commit dd2321f

Browse files
brianlovinclaude
andcommitted
Use OIDC trusted publishing for platform packages
Switch from manual ~/.npmrc token handling to OIDC with --provenance flag, matching how the main package is published. This uses npm's recommended approach for trusted publishing from GitHub Actions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 268d045 commit dd2321f

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,15 @@ jobs:
3636
registry-url: 'https://registry.npmjs.org'
3737

3838
# Publish platform packages first (they must exist before main package)
39+
# Using OIDC trusted publishing (same as main package)
3940
- name: Publish platform packages
4041
env:
41-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4243
run: |
43-
# Write .npmrc with auth token (setup-node's .npmrc doesn't work for subdirectory publishing)
44-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
4544
for dir in dist/binaries/*/; do
4645
name=$(basename "$dir")
4746
echo "Publishing $name..."
48-
(cd "$dir" && npm publish --access public) || echo "Package may already exist, continuing..."
47+
(cd "$dir" && npm publish --provenance --access public) || echo "Package may already exist, continuing..."
4948
done
5049
5150
# Remove binaries from dist before publishing main package (they're in separate packages)

0 commit comments

Comments
 (0)