@@ -329,37 +329,25 @@ jobs:
329329 permissions :
330330 contents : read
331331 id-token : write
332+ # force empty so npm can use OIDC
333+ env :
334+ NODE_AUTH_TOKEN : " "
335+ NPM_TOKEN : " "
332336 steps :
333- - uses : actions/checkout@v4
334-
335- - uses : actions/setup-node@v4
336- with :
337- node-version : ' 22'
338- registry-url : ' https://registry.npmjs.org'
339-
340- - uses : pnpm/action-setup@v3
341- name : Install pnpm
342- id : pnpm-install
343- with :
344- version : latest
345- run_install : false
346-
347- - name : Get pnpm store directory
348- id : pnpm-cache
349- shell : bash
350- run : |
351- echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
352-
353- - uses : actions/cache@v4
354- name : Setup pnpm cache
355- with :
356- path : ${{ steps.pnpm-cache.outputs.STORE_PATH }}
357- key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
358- restore-keys : |
359- ${{ runner.os }}-pnpm-store-
360-
361- - name : Install dependencies
362- run : pnpm install
337+ - uses : actions/checkout@v5
338+ - uses : pnpm/action-setup@v4
339+ with : { run_install: false }
340+ - uses : actions/setup-node@v6
341+ with : { node-version: '24', cache: 'pnpm', cache-dependency-path: pnpm-lock.yaml }
342+ - run : pnpm install --frozen-lockfile --prefer-offline
343+
344+ # nuke, so npm can use OIDC
345+ - name : Remove temp npmrc
346+ run : rm -f "$NPM_CONFIG_USERCONFIG"
347+
348+ # >= 11.5.1 for trusted publishing
349+ - name : Update NPM
350+ run : npm install -g npm@latest
363351
364352 - name : Check preconditions
365353 id : checks
@@ -374,7 +362,6 @@ jobs:
374362
375363 if [[ "$is_version_published" == "true" ]]; then
376364 echo "\`${{ matrix.package }}$version\` already published, adding tag \`$tag\`" >> $GITHUB_STEP_SUMMARY
377- npm dist-tag add ${{ matrix.package }}@$version $tag
378365 else
379366 {
380367 echo "version=$version"
@@ -395,10 +382,11 @@ jobs:
395382 if : steps.checks.outputs.has_new_release == 'true'
396383 working-directory : ${{ matrix.package }}
397384 shell : bash
398- env :
399- NODE_AUTH_TOKEN : ${{ secrets.NPM_ACCESS_TOKEN }}
400385 run : npm run pack
401386
387+ # nuke, so npm can use OIDC
388+ - name : Remove temp npmrc
389+ run : rm -f "$NPM_CONFIG_USERCONFIG"
402390 - name : Publish
403391 if : github.event_name == 'push' && steps.checks.outputs.has_new_release == 'true'
404392 run : |
@@ -413,6 +401,4 @@ jobs:
413401 # Post release message to Discord
414402 # curl -X POST -H "Content-Type: application/json" -d "{\"embeds\": [{\"title\": \"New \`${{ matrix.package }}\` release! 🎉\", \"url\": \"https://www.npmjs.com/package/${{ matrix.package }}/v/$version\", \"color\": \"12907856\", \"fields\": [{\"name\": \"Version\", \"value\": \"\`$version\`\"}, {\"name\": \"Tag\", \"value\": \"\`$tag\`\"}]}]}" ${{ secrets.DISCORD_DEV_RELEASE_WEBHOOK_URL }}
415403 working-directory : ${{ matrix.package }}
416- shell : bash
417- env :
418- NODE_AUTH_TOKEN : ${{ secrets.NPM_ACCESS_TOKEN }}
404+ shell : bash
0 commit comments