Add make tasks for releasing

This commit is contained in:
Marcin Kulik
2014-11-13 19:39:51 +01:00
parent 507bdfa420
commit 999c5d2367

View File

@@ -1,6 +1,7 @@
VERSION = $(shell grep Version version.go | awk -F '"' '{print $$2}')
COMMIT = $(shell git rev-parse --short HEAD)
.PHONY: build test deps fmt fmtdiff travis gox
.PHONY: build test deps fmt fmtdiff travis gox tag push release
build: test
go build -o bin/asciinema -ldflags "-X main.GitCommit $(COMMIT)"
@@ -21,3 +22,13 @@ travis: build fmtdiff
gox:
gox -os="darwin linux" -arch="386 amd64" -output="bin/asciinema_{{.OS}}_{{.Arch}}" -ldflags "-X main.GitCommit $(COMMIT)"
tag:
git tag | grep "v$(VERSION)" && echo "Tag v$(VERSION) exists" && exit 1 || true
git tag -s -m "Releasing $(VERSION)" v$(VERSION)
git push --tags
push:
echo "TODO: uploading binaries to github release"
release: test tag push