|
30 | 30 | with: |
31 | 31 | node-version: '20' |
32 | 32 | registry-url: 'https://registry.npmjs.org' |
33 | | - # If NPM_TOKEN is set, it will be used; otherwise OIDC will be attempted |
| 33 | + # Pass NPM_TOKEN if available, otherwise OIDC will be attempted |
| 34 | + # For new packages, NPM_TOKEN is required for first publish |
| 35 | + env: |
| 36 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
34 | 37 |
|
35 | 38 | - name: Extract version from tag |
36 | 39 | id: version |
@@ -71,16 +74,14 @@ jobs: |
71 | 74 | - name: Publish to npm |
72 | 75 | run: | |
73 | 76 | cd packages/wex-threejs |
74 | | - # For brand new packages, npm Trusted Publishing (OIDC) may not work |
75 | | - # If this step fails, create an NPM_TOKEN secret in GitHub: |
| 77 | + # NPM_TOKEN secret is required for first-time publishing |
| 78 | + # If this step fails with "404 Not Found" or "Access token expired": |
76 | 79 | # 1. Go to https://www.npmjs.com/settings/YOUR_USERNAME/tokens |
77 | 80 | # 2. Generate a new "Automation" token with "Publish" permission |
78 | 81 | # 3. Add it as a secret: GitHub repo > Settings > Secrets > Actions > New secret |
79 | 82 | # Name: NPM_TOKEN, Value: your token |
80 | | - # After first publish, you can remove NPM_TOKEN and use OIDC only |
| 83 | + # After first publish, you can optionally remove NPM_TOKEN and use OIDC only |
81 | 84 | npm publish --access public --provenance |
82 | | - env: |
83 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
84 | 85 |
|
85 | 86 | - name: Create GitHub Release |
86 | 87 | uses: softprops/action-gh-release@v1 |
|
0 commit comments