@@ -12,26 +12,43 @@ name: Publish Package to npmjs
1212on :
1313 release :
1414 types : [created]
15+ permissions :
16+ id-token : write
17+ contents : read
18+ env :
19+ NODE_OPTIONS : " --max_old_space_size=4096"
1520jobs :
1621 build :
1722 runs-on : ubuntu-latest
1823 steps :
19- - uses : actions/checkout@v2
24+ - uses : actions/checkout@v4
25+
26+ # Setup Node.js version first
27+ - uses : actions/setup-node@v3
28+ with :
29+ node-version : " 22.18.0"
30+ always-auth : true
31+ registry-url : " https://registry.npmjs.org"
2032
2133 # Note we set an `id` called `release`. We'll use that later...
2234 - name : Validate and extract release information
2335 id : release
24362537
26- # Setup .npmrc file to publish to npm
27- - uses : actions/setup-node@v3
28- with :
29- node-version : " 16.x"
30- always-auth : true
31- registry-url : " https://registry.npmjs.org"
38+ - name : Install dependencies
39+ run : yarn install --frozen-lockfile
40+
41+ - name : Build
42+ run : yarn build
43+
44+ - name : Update npm
45+ run : npm install -g npm@latest
3246
33- # Perform installs, run tests, run a build step, etc. here, as needed.
34- - run : yarn
47+ - name : Log Node & npm versions (after update)
48+ # Make sure we hit 11.5.1 version requirement for Trusted Publishing
49+ run : |
50+ node -v
51+ npm -v
3552
3653 # The last two steps will publish the package. Note that we're using
3754 # information from the `release` step above (I told you we'd use it
5370 # This will publish a version of a package.
5471 - name : Publish version
5572 if : steps.release.outputs.tag == ''
56- run : yarn publish
57- env :
58- NPM_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
73+ run : npm publish
5974
6075 - name : Publish tagged version
6176 if : steps.release.outputs.tag != ''
62- run : yarn publish --tag ${{ steps.release.outputs.tag }}
63- env :
64- NPM_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
77+ run : npm publish --tag ${{ steps.release.outputs.tag }}
0 commit comments