github.com/99designs/gqlgen@v0.17.45/bin/release (about) 1 #!/bin/bash 2 3 set -eu 4 5 if ! [ $# -eq 1 ] ; then 6 echo "usage: ./bin/release [version]" 7 exit 1 8 fi 9 10 VERSION=$1 11 12 if ! git diff-index --quiet HEAD -- ; then 13 echo "uncommited changes on HEAD, aborting" 14 exit 1 15 fi 16 17 if [[ ${VERSION:0:1} != "v" ]] ; then 18 echo "version strings must start with v" 19 exit 1 20 fi 21 22 git fetch origin 23 git checkout origin/master 24 25 cat > graphql/version.go <<EOF 26 package graphql 27 28 const Version = "$VERSION" 29 EOF 30 go generate ./...; cd _examples; go generate ./...; cd .. 31 git add . 32 33 git commit -m "release $VERSION" 34 git tag $VERSION 35 git push origin $VERSION 36 git push origin HEAD:master 37 38 cat > graphql/version.go <<EOF 39 package graphql 40 41 const Version = "$VERSION-dev" 42 EOF 43 go generate ./...; cd _examples; go generate ./...; cd .. 44 git add . 45 git commit -m "$VERSION postrelease bump" 46 git push origin HEAD:master 47 git checkout master 48 git pull 49 50 51 echo "Now go write some release notes! https://github.com/99designs/gqlgen/releases"