Commit 36ca9e5 1 parent ed6ff3b commit 36ca9e5 Copy full SHA for 36ca9e5
File tree 2 files changed +126
-4
lines changed
2 files changed +126
-4
lines changed Original file line number Diff line number Diff line change 1
- name : Tests
2
-
1
+ name : Test & Maybe Release
3
2
on : [push, pull_request]
4
-
5
3
jobs :
6
- run :
4
+ test :
7
5
name : Node ${{ matrix.node }} on ${{ matrix.os }}
8
6
runs-on : ${{ matrix.os }}
9
7
47
45
48
46
- name : Run tests
49
47
run : npm test
48
+
49
+ release :
50
+ name : Release
51
+ needs : test
52
+ runs-on : ubuntu-latest
53
+ if : github.event_name == 'push' && github.ref == 'refs/heads/master'
54
+
55
+ steps :
56
+ - name : Checkout
57
+
58
+ with :
59
+ fetch-depth : 0
60
+
61
+ - name : Setup Node.js
62
+
63
+ with :
64
+ node-version : 14
65
+
66
+ - name : Install dependencies
67
+ run : |
68
+ npm install --no-progress --no-package-lock --no-save
69
+
70
+ - name : Build
71
+ run : |
72
+ npm run build
73
+
74
+ - name : Install plugins
75
+ run : |
76
+ npm install \
77
+ @semantic-release/commit-analyzer \
78
+ conventional-changelog-conventionalcommits \
79
+ @semantic-release/release-notes-generator \
80
+ @semantic-release/npm \
81
+ @semantic-release/github \
82
+ @semantic-release/git \
83
+ @semantic-release/changelog \
84
+ --no-progress --no-package-lock --no-save
85
+
86
+ - name : Release
87
+ env :
88
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
89
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
90
+ run : npx semantic-release
Original file line number Diff line number Diff line change 44
44
"lint" : " standard" ,
45
45
"unit" : " tap --no-check-coverage test.js" ,
46
46
"test" : " npm run lint && npm run unit"
47
+ },
48
+ "release" : {
49
+ "branches" : [
50
+ " main"
51
+ ],
52
+ "plugins" : [
53
+ [
54
+ " @semantic-release/commit-analyzer" ,
55
+ {
56
+ "preset" : " conventionalcommits" ,
57
+ "releaseRules" : [
58
+ {
59
+ "breaking" : true ,
60
+ "release" : " major"
61
+ },
62
+ {
63
+ "revert" : true ,
64
+ "release" : " patch"
65
+ },
66
+ {
67
+ "type" : " feat" ,
68
+ "release" : " minor"
69
+ },
70
+ {
71
+ "type" : " fix" ,
72
+ "release" : " patch"
73
+ },
74
+ {
75
+ "type" : " chore" ,
76
+ "release" : " patch"
77
+ },
78
+ {
79
+ "type" : " docs" ,
80
+ "release" : " patch"
81
+ },
82
+ {
83
+ "type" : " test" ,
84
+ "release" : " patch"
85
+ },
86
+ {
87
+ "scope" : " no-release" ,
88
+ "release" : false
89
+ }
90
+ ]
91
+ }
92
+ ],
93
+ [
94
+ " @semantic-release/release-notes-generator" ,
95
+ {
96
+ "preset" : " conventionalcommits" ,
97
+ "presetConfig" : {
98
+ "types" : [
99
+ {
100
+ "type" : " feat" ,
101
+ "section" : " Features"
102
+ },
103
+ {
104
+ "type" : " fix" ,
105
+ "section" : " Bug Fixes"
106
+ },
107
+ {
108
+ "type" : " chore" ,
109
+ "section" : " Trivial Changes"
110
+ },
111
+ {
112
+ "type" : " docs" ,
113
+ "section" : " Trivial Changes"
114
+ },
115
+ {
116
+ "type" : " test" ,
117
+ "section" : " Tests"
118
+ }
119
+ ]
120
+ }
121
+ }
122
+ ],
123
+ " @semantic-release/changelog" ,
124
+ " @semantic-release/npm" ,
125
+ " @semantic-release/github" ,
126
+ " @semantic-release/git"
127
+ ]
47
128
}
48
129
}
You can’t perform that action at this time.
0 commit comments