File tree Expand file tree Collapse file tree 1 file changed +20
-8
lines changed
Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change 1- # From https://docs.github.com/en/actions/tutorials/publish-packages/publish-nodejs-packages#publishing-packages-to-the-npm-registry
2-
31name : Publish Package to npmjs
42on :
53 release :
86 build :
97 runs-on : ubuntu-latest
108 permissions :
11- contents : read
9+ contents : write
1210 id-token : write
1311 steps :
14- - uses : actions/checkout@v5
15- - uses : actions/setup-node@v4
12+ - name : Checkout code
13+ uses : actions/checkout@v5
14+ - name : Get release version
15+ id : get_version
16+ run : echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
17+ - name : Update package.json
18+ run : npm version "${{ steps.get_version.outputs.RELEASE_VERSION }}" --no-git-tag-version
19+ - name : Commit package.json changes
20+ uses : stefanzweifel/git-auto-commit-action@v6
21+ with :
22+ commit_message : " Update package.json version to ${{ steps.get_version.outputs.RELEASE_VERSION }}"
23+ branch : main
24+ - name : Set up Node.js
25+ uses : actions/setup-node@v4
1626 with :
1727 node-version : ' 20.x'
1828 registry-url : ' https://registry.npmjs.org'
19- - run : npm ci
20- - run : npm publish --provenance --access public
29+ - name : Install dependencies
30+ run : npm ci
31+ - name : Push to npmjs
32+ run : npm publish --provenance --access public
2133 env :
22- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
34+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments