-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
43 lines (33 loc) · 952 Bytes
/
Makefile
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
BIN = ./node_modules/.bin
SRC = $(wildcard src/*.js.coffee)
LIB = $(SRC:src/%.coffee=lib/%.js)
build:
@mkdir -p $(@D)
@$(BIN)/coffee -co lib/ src/
test:
npm test
clean:
@rm -rf lib
docs:
@$(BIN)/codo
install link: @npm $@
release-patch: clean build test docs
@$(call release,patch)
release-minor: clean build test docs
@$(call release,minor)
release-major: clean build test docs
@$(call release,major)
publish:
git push --tags origin HEAD:master
npm publish
define release
VERSION=`node -pe "require('./package.json').version"` && \
NEXT_VERSION=`node -pe "require('semver').inc(\"$$VERSION\", '$(1)')"` && \
node -e "\
var j = require('./package.json');\
j.version = \"$$NEXT_VERSION\";\
var s = JSON.stringify(j, null, 2);\
require('fs').writeFileSync('./package.json', s);" && \
git commit -m "release $$NEXT_VERSION" -- package.json && \
git tag "$$NEXT_VERSION" -m "release $$NEXT_VERSION"
endef