diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6e95a41 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ + +VERSION=0.0.1 + +all: build test + +build: + go build ./... + +test: + go test ./... + +release: all + hack/tag-release.sh $(VERSION) diff --git a/hack/tag-release.sh b/hack/tag-release.sh new file mode 100755 index 0000000..3bdc7a4 --- /dev/null +++ b/hack/tag-release.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Apply and push a release tag. +set -e +VERSION=$1 +[[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[^[:space:]]+)?$ ]] || { + echo "not a semantic version X.Y.Z: $VERSION" + exit 1 +} +[ "$(git status -s)" = "" ] || { + git status + echo "working directory not clean" + exit 1 +} +set -x +git tag "v$VERSION" -a -m "Release $VERSION" +git push --follow-tags