-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathGruntfile.js
91 lines (86 loc) · 3.01 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
module.exports = function (grunt) {
grunt.config.data.bower = require('./bower.json');
grunt.initConfig({
"steal-build": {
bundle: {
options: {
system: {
config: "bower.json!bower"
}
}
}
},
copy: {
release: {
files: [
{
expand: true,
src: [
'bower_components/steal/steal.production.js',
'bower_components/jquery-ui/themes/redmond/images/**',
'dist/bundles/**',
'LICENSE',
'README.md'
],
dest: 'tmp/'
}
]
}
},
clean: {
release: ["tmp"]
},
'string-replace': {
release: {
files: {
'tmp/': 'index.html'
},
options: {
replacements: [{
pattern: 'bower_components\/steal\/steal\.js',
replacement: 'bower_components/steal/steal.production.js'
}]
}
}
},
zip: {
'release': {
router: function (filepath) {
return filepath.replace(/^tmp/, 'mqtt-admin');
},
src: ['tmp/**'],
dest: 'releases/mqtt-admin_' + grunt.config.data.bower.version + '.zip'
}
},
bump: {
options: {
files: ['bower.json'],
updateConfigs: ['bower'],
commit: false,
commitMessage: 'Release v%VERSION%',
commitFiles: ['package.json'],
createTag: false,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: false,
pushTo: 'upstream',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d',
globalReplace: false,
regExp: false,
prereleaseName: 'beta'
}
}
});
grunt.loadNpmTasks("steal-tools");
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-string-replace');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-zip');
grunt.registerTask("build", ["steal-build", "clean", "copy", "string-replace"]);
grunt.registerTask("release prerelease", ["bump:prerelease", "build", "zip"]);
grunt.registerTask("release patch", ["bump:patch", "build", "zip"]);
grunt.registerTask("release minor", ["bump:minor", "build", "zip"]);
grunt.registerTask("release major", ["bump:major", "build", "zip"]);
grunt.registerTask("release premajor", ["bump:premajor", "build", "zip"]);
};