-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af6c60b
commit b530bbb
Showing
1 changed file
with
28 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,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
version=$1 | ||
|
||
if [ -z "$version" ]; then | ||
echo "No version passed! Example usage: ./release.sh 1.0.0" | ||
exit 1 | ||
fi | ||
|
||
echo "Running tests..." | ||
go test ./... | ||
|
||
echo "Update version..." | ||
sed -i.bak 's/fmt\.Println("v[0-9]*\.[0-9]*\.[0-9]*")/fmt.Println("v'$version'")/' captain/cmd.go | ||
rm captain/cmd.go.bak | ||
|
||
echo "Build binary..." | ||
make b | ||
|
||
echo "Update repository..." | ||
git add captain/cmd.go | ||
git commit -m "Preparing version ${version}" | ||
git tag --message="v$version" "v$version" | ||
|
||
echo "v$version tagged." | ||
echo "Now, run 'git push origin master && git push --tags' and publish the release on GitHub." |