-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
64 lines (54 loc) · 1.85 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
module.exports = function(grunt) {
grunt.initConfig({
version: process.env.VERSION || '0.0.0',
pkg: grunt.file.readJSON('package.json'),
clean: [
'build/'
],
copy: {
main: {
files: [
{ src: ['**/*.*'], dest: 'build/<%= pkg.name %>-<%= version %>/', cwd: 'src/', expand: true }
]
}
},
setversion: {
main: {
options: {
manifest_file: 'build/<%= pkg.name %>-<%= version %>/manifest.json',
version: '<%= version %>'
}
}
},
compress: {
main: {
options: {
archive: 'build/<%= pkg.name %>-<%= version %>.zip'
},
files: [
{ src: ['**/*.*'], dest: '/', cwd: 'build/<%= pkg.name %>-<%= version %>/', expand: true }
]
}
},
webstorepublish: {
main: {
options: {
package: 'build/<%= pkg.name %>-<%= version %>.zip',
client_id: process.env.CLIENT_ID,
client_secret: process.env.CLIENT_SECRET,
refresh_token: process.env.REFRESH_TOKEN,
app_id: process.env.APP_ID
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-compress');
// Load custom tasks
grunt.loadTasks('tasks/');
// Default task
grunt.registerTask('default', ['clean', 'copy', 'setversion', 'compress']);
// Publish task
grunt.registerTask('publish', ['default', 'webstorepublish']);
};