File tree Expand file tree Collapse file tree 2 files changed +50
-3
lines changed Expand file tree Collapse file tree 2 files changed +50
-3
lines changed Original file line number Diff line number Diff line change 1+ name : npm bump
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ newversion :
7+ description : " npm version {major,minor,patch}"
8+ required : true
9+
10+ env :
11+ node_version : " 19"
12+ FORCE_COLOR : 1
13+
14+ concurrency : # prevent concurrent releases
15+ group : npm-bump
16+ cancel-in-progress : true
17+
18+ jobs :
19+ version_and_release :
20+ runs-on : ubuntu-latest
21+ steps :
22+ - uses : actions/checkout@v2
23+ with :
24+ # fetch full history so things like auto-changelog work properly
25+ fetch-depth : 0
26+ - name : Use Node.js ${{ env.node_version }}
27+ uses : actions/setup-node@v2
28+ with :
29+ node-version : ${{ env.node_version }}
30+ # setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
31+ registry-url : " https://registry.npmjs.org"
32+ - run : npm i
33+ - run : npm test
34+ - name : npm version && npm publish
35+ uses : bcomnes/npm-bump@v2
36+ with :
37+ 38+ git_username : ${{ github.actor }}
39+ newversion : ${{ github.event.inputs.newversion }}
40+ github_token : ${{ secrets.GITHUB_TOKEN }} # built in actions token. Passed tp gh-release if in use.
41+ npm_token : ${{ secrets.NPM_ORG_TOKEN }} # user set secret token generated at npm
42+ publish_cmd : npm publish --provenance
Original file line number Diff line number Diff line change 3838 "clean:declarations" : " rm -rf $(find . -maxdepth 2 -type f -name '*.d.ts*')" ,
3939 "clean" : " run-p clean:*" ,
4040 "prepare" : " husky install" ,
41- "prepublishOnly" : " run-s build" ,
41+ "prepublishOnly" : " git push --follow-tags && gh-release -y && run-s build" ,
4242 "test:mocha" : " c8 --reporter=lcov --reporter text mocha 'test/**/*.spec.js'" ,
4343 "test-ci" : " run-s test:*" ,
44- "test" : " run-s check test:*"
44+ "test" : " run-s check test:*" ,
45+ "version" : " run-s prepare version:*" ,
46+ "version:changelog" : " auto-changelog -p --template keepachangelog auto-changelog --breaking-pattern 'BREAKING CHANGE:'" ,
47+ "version:git" : " git add CHANGELOG.md"
4548 },
4649 "devDependencies" : {
4750 "@socketsecurity/eslint-config" : " ^2.0.0" ,
7275 "mocha" : " ^10.0.0" ,
7376 "npm-run-all2" : " ^6.0.2" ,
7477 "type-coverage" : " ^2.24.1" ,
75- "typescript" : " ~4.9.5"
78+ "typescript" : " ~4.9.5" ,
79+ "auto-changelog" : " ^2.4.0" ,
80+ "gh-release" : " ^7.0.2"
7681 },
7782 "dependencies" : {
7883 "ajv" : " ^8.12.0" ,
You can’t perform that action at this time.
0 commit comments