File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change 1- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
1+ # This workflow will run tests using node and then publish a package to npm when a release is created
22# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3-
43name : publish-cloud-to-npm
5-
64on :
75 release :
86 types : [published]
97jobs :
108 build :
119 if : github.event.release.target_commitish == 'main'
1210 runs-on : ubuntu-latest
11+ permissions :
12+ id-token : write
1313 steps :
1414 - uses : actions/checkout@v4
1515 - uses : actions/setup-node@v4
1616 with :
17- node-version : ' 18.x'
18- registry-url : ' https://registry.npmjs.org'
17+ node-version : ' 18.18.0'
18+ - name : Setup yarn
19+ run : npm install -g yarn
1920 - name : Compare package.json version with tag
2021 run : |
2122 TAG_VERSION=${GITHUB_REF#refs/tags/}
@@ -39,10 +40,11 @@ jobs:
3940 run : yarn install --frozen-lockfile
4041 - name : Publish package
4142 run : |
43+ publish() {
44+ npx -y npm@latest publish "$@"
45+ }
4246 if [ "$is_next" = "true" ]; then
43- yarn publish --tag preview
47+ publish --tag preview
4448 else
45- yarn publish
49+ publish
4650 fi
47- env :
48- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments