forked from yeoman/generator-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
61 lines (56 loc) · 1.38 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
'use strict';
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
jshint: {
all: {
options: {
jshintrc: './.jshintrc'
},
src: [
'**/index.js',
'*.js',
'!test/**/*.js',
'!node_modules/**/*.js'
]
}
},
conventionalGithubReleaser: {
release: {
options: {
auth: {
type: 'oauth',
token: process.env.GITHUB_AUTHTOKEN
},
changelogOpts: {
preset: 'angular',
releaseCount: 1
}
},
}
},
bump: {
options: {
commitMessage: 'chore(release): Release version <%= version %>'
}
}
});
grunt.registerTask('default', ['jshint']);
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([
'default',
'bump' + (type ? ':' + type : ''),
'npmPublish',
'conventionalGithubReleaser'
]);
});
};