File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 required : true
1010 default : false
1111
12- permissions :
13- contents : read
14- id-token : write
15-
1612jobs :
1713 get-version-channel :
1814 runs-on : ubuntu-latest
@@ -32,11 +28,39 @@ jobs:
3228 needs : [get-version-channel]
3329 # if NOT isStableCandidate confirm dist tag is in package.json version
3430 if : fromJSON(needs.get-version-channel.outputs.isStableRelease) || (!fromJSON(inputs.isStableCandidate) && !!needs.get-version-channel.outputs.channel)
35- uses : ./.github/workflows/publish-npm.yml
36- with :
37- isStableRelease : ${{ fromJSON(needs.get-version-channel.outputs.isStableRelease) }}
38- channel : ${{ needs.get-version-channel.outputs.channel }}
39- secrets : inherit
31+ # pub-hk-ubuntu-22.04- due to IP allow list issues with public repos: https://salesforce.quip.com/bu6UA0KImOxJ
32+ runs-on : pub-hk-ubuntu-22.04-small
33+ permissions :
34+ contents : read
35+ id-token : write
36+ steps :
37+ - uses : actions/checkout@v6
38+ - name : Use Node.js 22.x
39+ uses : actions/setup-node@v6
40+ with :
41+ node-version : 22.x
42+ cache : npm
43+ registry-url : ' https://registry.npmjs.org'
44+ - run : npm ci
45+ - name : Update npm for trusted publishing
46+ run : npm install -g npm@latest
47+ - name : Publish to NPM
48+ run : |
49+ PACKAGE_VERSION=$(node -e "console.log(require('./package.json').version)")
50+ PACKAGE_NAME=$(node -e "console.log(require('./package.json').name)")
51+
52+ if npm view $PACKAGE_NAME@$PACKAGE_VERSION version &>/dev/null; then
53+ echo "Version $PACKAGE_VERSION already published to npm, skipping"
54+ exit 0
55+ fi
56+
57+ if ${{ fromJSON(needs.get-version-channel.outputs.isStableRelease) }}
58+ then
59+ npm publish
60+ else
61+ npm publish --tag ${{ needs.get-version-channel.outputs.channel || 'beta' }}
62+ fi
63+ shell : bash
4064
4165 pack-upload :
4266 needs : [publish-npm]
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments