File tree Expand file tree Collapse file tree 8 files changed +90
-13
lines changed Expand file tree Collapse file tree 8 files changed +90
-13
lines changed Original file line number Diff line number Diff line change @@ -127,9 +127,12 @@ $ gulp build
127
127
2 . Run tests
128
128
3 . Build everything
129
129
4 . Bump the version in ` package.json `
130
- 5 . Commit the version change
131
- 6 . Create a git tag
132
- 7 . Run ` git push ` to ` upstream/master `
130
+ 5 . Generate a changelog based on the git log
131
+ 6 . Commit the version change & ` CHANGELOG.md `
132
+ 7 . Create a git tag
133
+ 8 . Run ` git push ` to ` upstream/master `
134
+ 9 . Publish a release to Github releases (if ` GH_TOKEN ` is available)
135
+ 10 . Publish to npm
133
136
134
137
``` bash
135
138
# Major release
@@ -151,6 +154,15 @@ $ aegir-release --env node
151
154
$ gulp release --env node
152
155
```
153
156
157
+ You can generate a changelog for all versions by using ` --first `
158
+
159
+ ``` bash
160
+ $ aegir-relase --first
161
+ ```
162
+
163
+ You can skip all changelog generation and the github release by passing
164
+ in ` --no-changelog ` .
165
+
154
166
## Other Notes
155
167
156
168
There is a badge.
Original file line number Diff line number Diff line change 31
31
"babel-preset-es2015" : " ^6.9.0" ,
32
32
"brfs" : " ^1.4.3" ,
33
33
"chalk" : " ^1.1.3" ,
34
+ "conventional-github-releaser" : " ^1.1.3" ,
34
35
"coveralls" : " ^2.11.12" ,
35
36
"eslint" : " ^3.2.0" ,
36
37
"eslint-config-standard" : " ^5.3.5" ,
39
40
"gulp" : " ^3.9.1" ,
40
41
"gulp-babel" : " ^6.1.2" ,
41
42
"gulp-bump" : " ^2.2.0" ,
43
+ "gulp-conventional-changelog" : " ^1.1.0" ,
42
44
"gulp-eslint" : " ^3.0.1" ,
43
45
"gulp-filter" : " ^4.0.0" ,
44
46
"gulp-git" : " ^1.10.0" ,
Original file line number Diff line number Diff line change 2
2
3
3
const runSequence = require ( 'run-sequence' )
4
4
const $ = require ( 'gulp-load-plugins' ) ( )
5
+ const fs = require ( 'fs' )
5
6
6
7
// Workaround gulp not exiting if there are some
7
8
// resources not freed
@@ -34,3 +35,7 @@ exports.fail = (msg) => {
34
35
$ . util . log ( $ . util . colors . red ( msg ) )
35
36
process . exit ( 1 )
36
37
}
38
+
39
+ exports . getVersion = ( ) => {
40
+ return JSON . parse ( fs . readFileSync ( './package.json' , 'utf8' ) ) . version
41
+ }
Original file line number Diff line number Diff line change 2
2
3
3
const $ = require ( 'gulp-load-plugins' ) ( )
4
4
const semver = require ( 'semver' )
5
- const fs = require ( 'fs' )
6
5
const _ = require ( 'lodash' )
7
6
7
+ const getVersion = require ( '../../src/utils' ) . getVersion
8
+
8
9
function getType ( ) {
9
10
if ( _ . includes ( $ . util . env . _ , 'major' ) ) return 'major'
10
11
if ( _ . includes ( $ . util . env . _ , 'minor' ) ) return 'minor'
@@ -13,21 +14,13 @@ function getType () {
13
14
return 'patch'
14
15
}
15
16
16
- function getCurrentVersion ( ) {
17
- return JSON . parse ( fs . readFileSync ( './package.json' , 'utf8' ) ) . version
18
- }
19
-
20
17
module . exports = ( gulp , done ) => {
21
18
const type = getType ( )
22
- const newVersion = semver . inc ( getCurrentVersion ( ) , type )
19
+ const newVersion = semver . inc ( getVersion ( ) , type )
23
20
24
21
$ . util . log ( 'Releasing %s' , newVersion )
25
22
26
23
return gulp . src ( './package.json' )
27
24
. pipe ( $ . bump ( { version : newVersion } ) )
28
25
. pipe ( gulp . dest ( './' ) )
29
- . pipe ( $ . git . add ( ) )
30
- . pipe ( $ . git . commit ( `chore: release version v${ newVersion } ` , { args : '-n' } ) )
31
- . pipe ( $ . filter ( 'package.json' ) )
32
- . pipe ( $ . tagVersion ( ) )
33
26
}
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ const $ = require ( 'gulp-load-plugins' ) ( )
4
+
5
+ module . exports = ( gulp , done ) => {
6
+ if ( $ . util . env . changelog === false ) {
7
+ $ . util . log ( 'Skipping changelog generation' )
8
+ return done ( )
9
+ }
10
+
11
+ const releaseCount = $ . util . env . first ? 0 : 1
12
+
13
+ return gulp . src ( 'CHANGELOG.md' )
14
+ . pipe ( $ . conventionalChangelog ( {
15
+ preset : 'angular' ,
16
+ releaseCount
17
+ } ) )
18
+ . pipe ( gulp . dest ( './' ) )
19
+ }
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ const $ = require ( 'gulp-load-plugins' ) ( )
4
+
5
+ const getVersion = require ( '../../src/utils' ) . getVersion
6
+
7
+ module . exports = ( gulp , done ) => {
8
+ const newVersion = getVersion ( )
9
+
10
+ return gulp . src ( [ 'package.json' , 'CHANGELOG.md' ] )
11
+ . pipe ( $ . git . add ( ) )
12
+ . pipe ( $ . git . commit ( `chore: release version v${ newVersion } ` , { args : '-n' } ) )
13
+ . pipe ( $ . filter ( 'package.json' ) )
14
+ . pipe ( $ . tagVersion ( ) )
15
+ }
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ const $ = require ( 'gulp-load-plugins' ) ( )
4
+ const conventionalGithubReleaser = require ( 'conventional-github-releaser' )
5
+
6
+ module . exports = ( gulp , done ) => {
7
+ if ( $ . util . env . changelog === false ) {
8
+ $ . util . log ( 'Skipping github release' )
9
+ return done ( )
10
+ }
11
+
12
+ const token = process . env . GH_TOKEN || $ . util . env . token
13
+
14
+ if ( ! token ) {
15
+ $ . util . log ( $ . util . colors . yellow ( `
16
+ Skipping Github release as you are missing an oauth token.
17
+ You can supply one by either using $GH_TOKEN or --token.
18
+ ` ) )
19
+ return done ( )
20
+ }
21
+
22
+ conventionalGithubReleaser ( {
23
+ type : 'oauth' ,
24
+ token
25
+ } , {
26
+ preset : 'angular'
27
+ } , done )
28
+ }
Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ module.exports = (gulp, done) => {
6
6
runSequence . use ( gulp ) (
7
7
'release:contributors' ,
8
8
'release:bump' ,
9
+ 'release:changelog' ,
10
+ 'release:commit' ,
9
11
'release:push' ,
12
+ 'release:github' ,
10
13
'release:publish' ,
11
14
done
12
15
)
You can’t perform that action at this time.
0 commit comments