66 runs-on : ubuntu-latest
77 steps :
88 - uses : actions/checkout@v4
9- - uses : actions/setup-node@v3.1.1
9+ - uses : actions/setup-node@v6
1010 with :
1111 node-version : ' 22.18.0'
1212 - run : npm install -g "yarn@1.22.5"
3333 steps :
3434 - uses : actions/checkout@v4
3535 - name : Use Node.js ${{ matrix.node-version }}
36- uses : actions/setup-node@v1
36+ uses : actions/setup-node@v6
3737 with :
3838 node-version : ${{ matrix.node-version }}
3939 - uses : nick-fields/retry@v2
4949 steps :
5050 - uses : actions/checkout@v4
5151 - name : Use Node.js 22.x
52- uses : actions/setup-node@v1
52+ uses : actions/setup-node@v6
5353 with :
5454 node-version : 22.x
5555 - uses : nick-fields/retry@v2
6868 fetch-depth : 100 # need the history to do a changed files check below (source, origin)
6969 - uses : actions/setup-python@v2
7070 - name : Use Node.js 22.x
71- uses : actions/setup-node@v1
71+ uses : actions/setup-node@v6
7272 with :
7373 node-version : 22.x
7474 - uses : nick-fields/retry@v2
@@ -84,28 +84,33 @@ jobs:
8484 build-to-npm :
8585 if : github.ref == 'refs/heads/main'
8686 runs-on : ubuntu-latest
87+ permissions :
88+ id-token : write
89+ contents : read
90+ packages : write
8791 needs :
8892 - run-depcheck
8993 - build-and-upload-artifacts
9094 - run-pre-commits
9195 steps :
9296 - name : Checkout
9397 uses : actions/checkout@v2
94- - uses : actions/setup-node@v2
98+ - uses : actions/setup-node@v6
9599 with :
96100 node-version : ' 22.x'
101+ # See: https://docs.npmjs.com/trusted-publishers
102+ # See: https://github.com/actions/setup-node/issues/1445
103+ - name : Set npm to version that supports trusted publishers
104+ run : npm install -g npm@11.5.1
105+ shell : bash
97106 - uses : nick-fields/retry@v2
98107 with :
99108 timeout_minutes : 6
100109 max_attempts : 3
101110 retry_on : error
102111 command : yarn install --immutable
103- - name : Configure NPM authentication
104- run : |
105- yarn config set npmAlwaysAuth true
106- yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }}
107112 - name : Publish to yarn/npm
108- run : yarn npm publish
113+ run : NODE_AUTH_TOKEN="" yarn npm publish
109114
110115 build-to-github-packages :
111116 if : github.ref == 'refs/heads/main'
@@ -117,7 +122,7 @@ jobs:
117122 steps :
118123 - name : Checkout
119124 uses : actions/checkout@v2
120- - uses : actions/setup-node@v2
125+ - uses : actions/setup-node@v6
121126 with :
122127 node-version : ' 22.x'
123128 - uses : nick-fields/retry@v2
0 commit comments