diff --git a/bin/release b/bin/release new file mode 100755 index 00000000000..43227fafb13 --- /dev/null +++ b/bin/release @@ -0,0 +1,37 @@ +#!/bin/bash + +set -eu + +if ! [ $# -eq 1 ] ; then + echo "usage: ./bin/release [version]" + exit 1 +fi + +VERSION=$1 + +if ! git diff-index --quiet HEAD -- ; then + echo "uncommited changes on HEAD, aborting" + exit 1 +fi + +if [[ ${VERSION:0:1} != "v" ]] ; then + echo "version strings must start with v" + exit 1 +fi + +git fetch origin +git checkout origin/master + +cat > graphql/version.go <