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 38
38
"clean:declarations" : " rm -rf $(find . -maxdepth 2 -type f -name '*.d.ts*')" ,
39
39
"clean" : " run-p clean:*" ,
40
40
"prepare" : " husky install" ,
41
- "prepublishOnly" : " run-s build" ,
41
+ "prepublishOnly" : " git push --follow-tags && gh-release -y && run-s build" ,
42
42
"test:mocha" : " c8 --reporter=lcov --reporter text mocha 'test/**/*.spec.js'" ,
43
43
"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"
45
48
},
46
49
"devDependencies" : {
47
50
"@socketsecurity/eslint-config" : " ^2.0.0" ,
72
75
"mocha" : " ^10.0.0" ,
73
76
"npm-run-all2" : " ^6.0.2" ,
74
77
"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"
76
81
},
77
82
"dependencies" : {
78
83
"ajv" : " ^8.12.0" ,
You can’t perform that action at this time.
0 commit comments