forked from loopj/node-sidekiq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
38 lines (31 loc) · 1.03 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
module.exports = (grunt) ->
# Configuration
grunt.initConfig
# Package information
pkg: grunt.file.readJSON "package.json"
# Coffeescript compilation
coffee:
compile:
files:
"lib/index.js": "src/index.coffee"
options:
bare: true
# Version bumping
bump:
options: part: "patch"
files: ["package.json"]
# Load tasks from plugins
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-bumpx"
# Task to tag a version in git
grunt.registerTask "git-tag", "Tags a release in git", ->
exec = require("child_process").exec
done = this.async()
releaseVersion = grunt.template.process("<%= pkg.version %>")
child = exec "git ci -am \"v#{releaseVersion}\" && git tag v#{releaseVersion}", (error, stdout, stderr) ->
console.log("Error running git tag: " + error) if error?
done(!error?)
# Release meta-task
grunt.registerTask "release", ["coffee", "git-tag"]
# Default meta-task
grunt.registerTask "default", ["coffee"]