-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.coffee
55 lines (43 loc) · 1.29 KB
/
Gruntfile.coffee
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
module.exports = (grunt) ->
require('load-grunt-tasks')(grunt)
grunt.initConfig {
pkg: grunt.file.readJSON "package.json"
bower: grunt.file.readJSON "bower.json"
dir:
src: "src"
dist: "dist"
files:
src: "<%= dir.src %>/*.coffee"
coffee:
compile:
files:
"<%= pkg.main %>": ["<%= files.src %>"]
uglify:
build:
src: "<%= pkg.main %>"
dest: "<%= pkg.minified %>"
watch:
coffee:
files: ["<%= files.src %>"]
tasks: "coffee"
clean: ["<%= dir.dist %>"]
bump:
options:
files: ["package.json", "bower.json"]
updateConfigs: ["pkg", "bower"]
commit: yes
commitMessage: "Release v%VERSION%"
commitFiles: ["-a"]
createTag: yes
tagName: "v%VERSION%"
tagMessage: "Version %VERSION%"
push: no
pushTo: "upstream"
gitDescribeOptions: "--tags --always --abbrev=1 --dirty=-d"
}
grunt.registerTask "build", ["clean", "coffee", "uglify"]
grunt.registerTask "default", ["clean", "coffee", "watch"]
# usage: grunt release[:major|:minor|:patch]
grunt.registerTask "release", "Release a new version", (target) ->
target ?= "patch"
grunt.task.run "bump-only:#{target}", "build", "bump-commit"