-
Notifications
You must be signed in to change notification settings - Fork 10
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
Showing
3 changed files
with
35 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
little_bigtable.db | ||
little_bigtable | ||
build | ||
dist |
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,33 @@ | ||
#!/bin/bash | ||
|
||
# 1. commit to bump the version (little_bigtable.go) | ||
# 2. tag that commit | ||
# 3. use dist.sh to produce tar.gz for all platforms | ||
# 4. update the release metadata on github / upload the binaries | ||
|
||
set -e | ||
|
||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
version=$(awk '/version / {print $NF}' < $DIR/little_bigtable.go | sed 's/"//g') | ||
goversion=$(go version | awk '{print $3}') | ||
|
||
echo "... running tests" | ||
./test.sh | ||
|
||
mkdir -p dist | ||
for target in "linux/amd64"; do | ||
os=${target%/*} | ||
arch=${target##*/} | ||
echo "... building v$version for $os/$arch" | ||
BUILD=$(mktemp -d ${TMPDIR:-/tmp}/build-XXXXX) | ||
TARGET="little_bigtable-$version.$os-$arch.$goversion" | ||
GOOS=$os GOARCH=$arch \ | ||
go build --tags "$os" -o $BUILD/$TARGET . | ||
pushd $BUILD | ||
sudo chown -R 0:0 $TARGET | ||
tar czvf $TARGET.tar.gz $TARGET | ||
mv $TARGET.tar.gz $DIR/dist | ||
popd | ||
sudo rm -r $BUILD | ||
done |