77
88permissions :
99 id-token : write
10+ contents : read
1011
1112jobs :
1213 release :
@@ -23,36 +24,47 @@ jobs:
2324 private_key : ${{ secrets.CT_CHANGESETS_APP_PEM }}
2425
2526 - name : Checkout
26- uses : actions/checkout@v4
27+ uses : actions/checkout@v5
2728 with :
2829 # Pass a personal access token (using our `ct-changesets` app) to be able to trigger other workflows
2930 # https://help.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token
3031 # https://github.community/t/action-does-not-trigger-another-on-push-tag-action/17148/8
3132 token : ${{ steps.generate_github_token.outputs.token }}
3233
34+ # Ensure we are using valid node version for npm trusted publising AFTER checkout
35+ # https://docs.npmjs.com/trusted-publishers#github-actions-configuration
36+ - uses : actions/setup-node@v4
37+ with :
38+ node-version : " 24"
39+ registry-url : " https://registry.npmjs.org"
40+
41+ # Ensure npm 11.5.1 or later is installed for OIDC support
42+ - name : Update npm
43+ run : npm install -g npm@latest
44+
45+ - name : Verify npm version
46+ run : npm --version
47+
3348 - name : Installing dependencies and building packages
3449 uses : ./.github/actions/ci
3550
36- - name : Setting up authorization to NPM registry (.npmrc)
37- run : |
38- cat << EOF > "$HOME/.npmrc"
39- provenance=true
40- 41- //registry.npmjs.org/:_authToken=$NPM_TOKEN
42- EOF
43- env :
44- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
51+ # Configure npm registry for trusted publishing (OIDC)
52+ # This must run AFTER the CI action to override the Node setup with registry config
53+ # https://docs.npmjs.com/trusted-publishers#github-actions-configuration
54+ - name : Setup npm registry for publishing
55+ uses : actions/setup-node@v4
56+ with :
57+ node-version : " 22"
58+ registry-url : " https://registry.npmjs.org"
4559
4660 - name : Storing release version for changeset
4761 id : release_version
48- run :
49- echo "VALUE=$(./scripts/print_release_version.sh)" >> $GITHUB_OUTPUT
62+ run : echo "VALUE=$(./scripts/print_release_version.sh)" >> $GITHUB_OUTPUT
5063 shell : bash
5164 env :
5265 GITHUB_TOKEN : ${{ steps.generate_github_token.outputs.token }}
5366
54- - name :
55- Creating release pull request or publishing release to npm registry
67+ - name : Creating release pull request or publishing release to npm registry
5668 id : changesets
5769 uses :
changesets/[email protected] 5870 with :
6779
6880 # Publish canary releases only if the packages weren't published already
6981 - name : Publishing canary releases to npm registry
70- if :
71- steps.changesets.outputs.published != 'true' && github.ref ==
82+ if : steps.changesets.outputs.published != 'true' && github.ref ==
7283 ' refs/heads/main'
7384 run : |
7485 git checkout main
0 commit comments