File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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
2- # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3-
41name : NPM Publish
52
63on :
96
107permissions :
118 id-token : write # Required for OIDC
12- contents : read
9+ contents : write # Required to push version bump commit
1310
1411jobs :
1512 publish-npm :
1613 runs-on : ubuntu-latest
1714 steps :
18- - uses : actions/checkout@v5
19- - uses : actions/setup-node@v5
15+ - uses : actions/checkout@v6
16+ - uses : actions/setup-node@v6
2017 with :
21- node-version : 22
22- registry-url : https://registry.npmjs.org/
23- - run : npm install -g npm@latest
18+ node-version : 24
19+ - run : npm ci --ignore-scripts --no-audit --no-fund
20+ - run : npm test
21+ - name : Bump version in package.json
22+ run : |
23+ VERSION="${{ github.event.release.tag_name }}"
24+ npm version "${VERSION#v}" --no-git-tag-version
25+ - name : Commit and push version bump
26+ run : |
27+ git config user.name "github-actions[bot]"
28+ git config user.email "github-actions[bot]@users.noreply.github.com"
29+ git add package.json package-lock.json
30+ git commit -m "chore: bump version to ${{ github.event.release.tag_name }}"
31+ git push origin HEAD:main
32+ - run : npm run build
2433 - run : npm publish --access public
You can’t perform that action at this time.
0 commit comments