@@ -227,7 +227,7 @@ jobs:
227227 RELEASE_COMMENT_ID : ${{ needs.release.outputs.comment-id }}
228228 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
229229 run : |
230- npm exec --offline -- template-oss-release-manager --lockfile=false --publish=false
230+ npm exec --offline -- template-oss-release-manager --lockfile=false --publish=true
231231 npm run rp-pull-request --ignore-scripts --if-present
232232 - name : Commit
233233 id : commit
@@ -376,70 +376,26 @@ jobs:
376376 defaults :
377377 run :
378378 shell : bash
379+ permissions :
380+ deployments : write
381+ id-token : write
379382 steps :
383+ - name : Checkout
384+ uses : actions/checkout@v3
385+ with :
386+ ref : ${{ fromJSON(needs.release.outputs.release).tagName }}
380387 - name : Setup Node
381388 uses : actions/setup-node@v3
382- id : node
383389 with :
384- node-version : 20.x
385- check-latest : contains('20.x', '.x')
386-
387- - name : Install Latest npm
388- shell : bash
389- env :
390- NODE_VERSION : ${{ steps.node.outputs.node-version }}
391- run : |
392- MATCH=""
393- SPECS=("latest" "next-10" "next-9" "next-8" "next-7" "next-6")
394-
395- echo "node@$NODE_VERSION"
396-
397- for SPEC in ${SPECS[@]}; do
398- ENGINES=$(npm view npm@$SPEC --json | jq -r '.engines.node')
399- echo "Checking if node@$NODE_VERSION satisfies npm@$SPEC ($ENGINES)"
400-
401- if npx semver -r "$ENGINES" "$NODE_VERSION" > /dev/null; then
402- MATCH=$SPEC
403- echo "Found compatible version: npm@$MATCH"
404- break
405- fi
406- done
407-
408- if [ -z $MATCH ]; then
409- echo "Could not find a compatible version of npm for node@$NODE_VERSION"
410- exit 1
411- fi
412-
413- npm i --prefer-online --no-fund --no-audit -g npm@$MATCH
414-
415- - name : npm Version
416- run : npm -v
417- - name : View in Registry
390+ node-version : 18.x
391+ - name : Install npm@latest
418392 run : |
419- EXIT_CODE=0
420-
421- function is_published {
422- if npm view "$@" --loglevel=error > /dev/null; then
423- echo 0
424- else
425- echo 1
426- fi
427- }
428-
429- for release in $(echo '${{ needs.release.outputs.releases }}' | jq -r '.[] | @base64'); do
430- name=$(echo "$release" | base64 --decode | jq -r .pkgName)
431- version=$(echo "$release" | base64 --decode | jq -r .version)
432- spec="$name@$version"
433- status=$(is_published "$spec")
434- if [[ "$status" -eq 1 ]]; then
435- echo "$spec ERROR"
436- EXIT_CODE=$status
437- else
438- echo "$spec OK"
439- fi
440- done
441-
442- exit $EXIT_CODE
393+ npm i --prefer-online --no-fund --no-audit -g npm@latest
394+ npm config set '//registry.npmjs.org/:_authToken'=\${PUBLISH_TOKEN}
395+ - name : Publish
396+ env :
397+ PUBLISH_TOKEN : ${{ secrets.PUBLISH_TOKEN }}
398+ run : npm publish --provenance --tag=latest
443399
444400 post-release-integration :
445401 needs : [ release, release-integration ]
0 commit comments