forked from ember-cli/ember-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
51 lines (41 loc) · 995 Bytes
/
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
'use strict';
var npm = require('npm');
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-release');
grunt.initConfig({
release: {
options: {
tagName: 'v<%= version %>',
commitMessage: 'bump v<%= version %> :tada:',
tagMessage: 'v<%= version %>'
}
}
});
grunt.registerTask('test', function() {
var done = this.async();
npm.load({
logLevel: 'error'
}, function(error) {
if(error) {
grunt.fail.fatal('Could not load npm');
return;
}
npm.runScript('test', function(error) {
if(error) {
grunt.fail.fatal('tests failed');
return;
}
grunt.log.write('tests passed, wtg');
done();
});
});
});
grunt.registerTask('ember:release', ['test', 'release']);
[
'patch',
'major',
'minor'
].forEach(function(level) {
grunt.registerTask('ember:release:' + level, ['test', 'release:' + level]);
});
};