44 workflow_dispatch :
55 inputs :
66 semver :
7- description : " The semantic version to bump (patch, minor, major) "
7+ description : " The semantic version to bump"
88 required : true
9+ type : choice
10+ options :
11+ - patch
12+ - minor
13+ - major
914 default : " patch"
1015 nodeVersion :
1116 description : " The Node.js version to use"
1217 required : true
13- default : " 16.x"
18+ type : choice
19+ options :
20+ - " 18.x"
21+ - " 20.x"
22+ - " 22.x"
23+ default : " 20.x"
1424
1525jobs :
1626 release :
@@ -27,26 +37,29 @@ jobs:
2737 node-version : ${{ github.event.inputs.nodeVersion }}
2838 registry-url : " https://registry.npmjs.org"
2939
30- - name : Bump version and push tag
40+ - name : Bump node-vault version
3141 run : |
32- git config --local user.email "action@github.com"
33- git config --local user.name "GitHub Action"
3442 npm version ${{ github.event.inputs.semver }}
35- git push && git push --tags
43+
44+ - name : Push changes
45+ uses : EndBug/add-and-commit@1bad3abcf0d6ec49a5857d124b0bfb52dc7bb081 # tag: v9.1.3
46+ with :
47+ default_author : github-actions
48+ add : " package.json package-lock.json"
49+ commit : --signoff
50+ message : " chore(release): bump version to ${{ github.event.inputs.semver }}"
3651
3752 - name : Publish
3853 run : npm publish
3954 env :
4055 NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
4156
42- - run : |
43- echo VERSION=$(cat package.json | grep version | tr -d " " | cut -d":" -f2 | tr -d "\",") >> $GITHUB_ENV
44- shell: bash
45- name: Set version as env var
57+ - name : Set version as env var
58+ run : |
59+ echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
4660
4761 - uses : actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e
4862 name : Release
49- id : create_release
5063 env :
5164 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5265 with :
0 commit comments