forked from arsmn/fastgql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request 99designs#326 from 99designs/version
Add version const
- Loading branch information
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <<EOF | ||
package graphql | ||
const Version = "$VERSION" | ||
EOF | ||
|
||
git add . | ||
git commit -m "release $VERSION" | ||
git tag $VERSION | ||
git push origin $VERSION | ||
|
||
|
||
echo "Now go write some release notes! https://github.com/99designs/gqlgen/releases" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/99designs/gqlgen/graphql" | ||
"github.com/urfave/cli" | ||
) | ||
|
||
var versionCmd = cli.Command{ | ||
Name: "version", | ||
Usage: "print the version string", | ||
Action: func(ctx *cli.Context) { | ||
fmt.Println(graphql.Version) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package graphql | ||
|
||
const Version = "dev" |