File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 permissions :
3333 contents : write
3434 packages : write
35- id-token : write # Required for npm Trusted Publishing
35+ id-token : write
3636 steps :
3737 - name : Checkout code
3838 uses : actions/checkout@v4
4444 uses : actions/setup-node@v4
4545 with :
4646 node-version : ' 18.x'
47- # This registry-url is crucial; it tells npm to use registry.npmjs.org
48- # and prepares the .npmrc for OIDC authentication.
4947 registry-url : ' https://registry.npmjs.org'
5048
5149 - name : Setup Bun
7876
7977 - name : Generate Changelog
8078 run : |
81- # Generate the full changelog
8279 npm run changelog
83- # Generate release notes for just this version
8480 npm run changelog:latest
8581
8682 - name : Build project
9591
9692 - name : Create and push tag
9793 run : |
98- # Delete the tag if it already exists locally
9994 git tag -d "v${{ env.VERSION }}" 2>/dev/null || true
100- # Delete the tag if it exists on the remote
10195 git push origin --delete "v${{ env.VERSION }}" 2>/dev/null || true
102- # Create and push the new tag
10396 git tag -a "v${{ env.VERSION }}" -m "Release v${{ env.VERSION }}"
10497 git push origin "v${{ env.VERSION }}"
10598
@@ -114,5 +107,7 @@ jobs:
114107 GITHUB_TOKEN : ${{ secrets.PAT_GITHUB }}
115108
116109 - name : Publish to npm
117- # No env variable needed here; auth is handled by id-token and registry-url
118110 run : npm publish --access public --provenance --tag ${{ github.event.inputs.dist_tag || 'latest' }}
111+ env :
112+ # Restored the token here to ensure it works
113+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments