-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
45 lines (41 loc) · 1.09 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
'use strict';
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
conventionalGithubReleaser: {
release: {
options: {
auth: {
type: 'oauth',
token: process.env.GITHUB_AUTHTOKEN
},
changelogOpts: {
preset: 'angular-require',
releaseCount: 1
}
}
}
},
bump: {
options: {
commitMessage: 'chore(release): Release version <%= version %>'
}
}
});
grunt.registerTask('npmPublish', 'Publish to npm', function () {
grunt.util.spawn({
cmd: 'npm',
args: ['publish']
}, grunt.task.current.async());
});
// grunt-release will only commit the package.json file by default. Until
// https://github.com/geddski/grunt-release/pull/43/files lands, it should
// be patched to do the same so it commits the changelog as well.
grunt.registerTask('publish', function (type) {
grunt.task.run([
'bump' + (type ? ':' + type : ''),
'npmPublish',
'conventionalGithubReleaser'
]);
});
};