From ada82174ded37364e8c2a39c9dbc8f3f5cf4fb3d Mon Sep 17 00:00:00 2001 From: David Chambers Date: Wed, 7 May 2014 18:41:01 -0700 Subject: [PATCH] makefile: add release-* targets --- Makefile | 9 +++++++++ package.json | 3 ++- scripts/prepublish | 15 +++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 scripts/prepublish diff --git a/Makefile b/Makefile index 7e539d8c6d..a50f45eafc 100644 --- a/Makefile +++ b/Makefile @@ -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/ @@ -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 diff --git a/package.json b/package.json index e803aff3dc..50af42e65f 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/scripts/prepublish b/scripts/prepublish new file mode 100755 index 0000000000..0192b315c8 --- /dev/null +++ b/scripts/prepublish @@ -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