diff --git a/README.md b/README.md index f082fa0..32108ae 100644 --- a/README.md +++ b/README.md @@ -52,12 +52,12 @@ $ go test ./... ## Release -In order to release a new version, set up github export GITHUB_TOKEN=[YOUR_TOKEN] and do the following steps: +In order to release a new version, set up github export GITHUB_TOKEN=[YOUR_TOKEN] + +Ensure your git repo is clean. Then update VERSION (no need to commit it, it will be committed automatically), and run: ``` -$ git tag -a vX.X.X -m "[Comment]" -$ git push origin vX.X.X -$ goreleaser +$ ./release.sh ``` ## Usage diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..2faa99e --- /dev/null +++ b/release.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -e +set -x + +die() { echo "$*" 1>&2 ; exit 1; } + +VERSION=`cat VERSION | tr -d '\n'` +git diff-index --quiet --cached HEAD -- || die "Index dirty, commit first" +go generate +git add VERSION +git add cli/version.go +git commit -m "Version $VERSION" +git tag -a v$VERSION -m "Version $VERSION" +git push origin v$VERSION +goreleaser