Skip to content

Commit

Permalink
script to tag releases and build binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatsuo committed Jun 30, 2014
1 parent 74ea7a8 commit 248d3a4
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tag.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env sh

TAG_NAME="$1"

if [ -z "$TAG_NAME" ]; then
echo 1>&2 'no tag name given'
exit 1
fi

build() {
os=$1
arch=$2
echo $os $arch
GOOS=$os GOARCH=$arch go build && tar czf "jqsh${TAG_NAME}.${os}-${arch}.tar.gz" jqsh && rm jqsh
[ $? -eq 0 ] || exit 1
}

if [ -n "`git status --porcelain`" ]; then
echo 1>&2 'repository is not clean'
exit 1
fi


if [ -n "`ls *.tar.gz 2>/dev/null`" ]; then
echo 1>&2 'remove previous distribution files'
exit 1
fi

git tag -a "$1"

build darwin amd64
build linux amd64

echo "all distributions built successfully"

0 comments on commit 248d3a4

Please sign in to comment.