-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathGruntfile.js
74 lines (62 loc) · 1.79 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
62
63
64
65
66
67
68
69
70
71
72
73
74
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bumpup: {
options: {
updateProps: {
pkg: 'package.json'
}
},
file: 'package.json'
},
yuidoc: {
compile: {
name: '<%= pkg.name %>',
version: '<%= pkg.version %>',
description: '<%= pkg.description %>',
url: '<%= pkg.url %>',
options: {
outdir: './docs',
linkNatives: true,
paths: ['./lib']
}
}
},
// Files that are copied or written over must be re-committed.
gitcommit: {
"commitupdated": {
options: {
message: 'Release <%= pkg.version %>.',
noVerify: true,
noStatus: false
},
files: {
src: ['docs']
}
}
},
// Push documentation to GitHub pages
'gh-pages': {
options: {
base: './docs'
},
src: ['**/*']
},
release: {
options: {
bump: false,
commitMessage: 'Release <%= version %>'
}
}
});
grunt.loadNpmTasks('grunt-bumpup');
grunt.loadNpmTasks("grunt-contrib-yuidoc");
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-release');
grunt.registerTask('publish', ['publish:patch']);
grunt.registerTask("publish:prerelease", ['bumpup:prerelease', 'yuidoc', 'gitcommit:commitupdated', 'gh-pages', 'release']);
grunt.registerTask("publish:patch", ['bumpup:patch', 'yuidoc', 'gitcommit:commitupdated', 'gh-pages', 'release']);
grunt.registerTask('publish:minor', ['bumpup:minor', 'yuidoc', 'gitcommit:commitupdated', 'gh-pages', 'release']);
grunt.registerTask('publish:major', ['bumpup:major', 'yuidoc', 'gitcommit:commitupdated', 'gh-pages', 'release']);
};