forked from jonas-koeritz/Taktische-Zeichen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
79 lines (75 loc) · 1.98 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
run: {
options: {
},
create_svgs: {
cmd: 'node',
args: [
'render.js',
'config.json',
'create-svgs'
]
},
render_all: {
cmd: 'node',
args: [
'render.js',
'config.json',
'render-all'
]
}
},
bump: {
options: {
files: ['package.json'],
commit: true,
updateConfigs: ['pkg'],
commitMessage: 'Release v%VERSION%',
commitFiles: ['-a'],
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'v%VERSION%',
push: true,
pushTo: 'origin',
globalReplace: false,
prereleaseName: false,
metadata: '',
regExp: false
}
},
publish: {
main: {
src: [
'.'
]
}
},
zip: {
release: {
src: ['128x128/**', '256x256/**', '512x512/**', '1024x1024/**', 'symbols/**'],
dest: 'release-v<%= pkg.version %>.zip',
router: function(filepath) {
if(filepath.startsWith('symbols/')) {
filepath = filepath.replace(/symbols/, 'svg');
}
console.log(filepath);
return filepath;
}
}
}
});
grunt.loadNpmTasks('grunt-run');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-publish');
grunt.loadNpmTasks('grunt-zip');
// Default task(s).
grunt.registerTask('default', ['run:create_svgs']);
grunt.registerTask('create-svgs', ['run:create_svgs'])
grunt.registerTask('render-all', ['run:create_svgs', 'run:render_all'])
grunt.registerTask('patch-release', ['bump:patch', 'zip:release', 'publish'])
grunt.registerTask('minor-release', ['bump:minor', 'zip:release', 'publish'])
grunt.registerTask('major-release', ['bump:major', 'zip:release', 'publish'])
};