Skip to content

Commit

Permalink
Added release script.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkapanidis committed Jun 28, 2015
1 parent af6c60b commit b530bbb
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions release.sh
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."

0 comments on commit b530bbb

Please sign in to comment.