Skip to content

Commit

Permalink
makefile: add release-* targets
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers committed May 8, 2014
1 parent 5dc9180 commit ada8217
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
REPORTER = dot
XYZ = node_modules/.bin/xyz --message 'Release X.Y.Z' --tag X.Y.Z --script scripts/prepublish

test:
@./node_modules/.bin/jshint lib/ test/
Expand All @@ -19,4 +20,12 @@ lib-cov:
bench:
@./benchmark/benchmark.js

.PHONY: release-major release-minor release-patch
release-major: LEVEL = major
release-minor: LEVEL = minor
release-patch: LEVEL = patch

release-major release-minor release-patch:
@$(XYZ) --increment $(LEVEL)

.PHONY: test build setup subl
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"expect.js": "~0.3.1",
"jsdom": "~0.8.9",
"jshint": "~2.3.0",
"mocha": "*"
"mocha": "*",
"xyz": "~0.3.0"
},
"scripts": {
"test": "make test"
Expand Down
15 changes: 15 additions & 0 deletions scripts/prepublish
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e

tmp="$(mktemp -t "$(basename "$0").XXXXXXXXXX")"

printf "
$VERSION / $(date +"%Y-%m-%d")
==================
$(git --no-pager log --no-merges --pretty="format: * %s (%an)" $PREVIOUS_VERSION..)
" >"$tmp"

cat History.md >>"$tmp"
mv "$tmp" History.md
git add History.md

0 comments on commit ada8217

Please sign in to comment.