Add script to package binaries

This commit is contained in:
Dan Sosedoff 2015-05-06 21:24:15 -05:00
parent 18b0260d1f
commit a65cca44e5
2 changed files with 19 additions and 1 deletions

View File

@ -40,11 +40,15 @@ build: assets
@echo "You can now execute ./pgweb"
release: assets
gox \
@echo "Building binaries..."
@gox \
-osarch="$(TARGETS)" \
-ldflags "-X github.com/sosedoff/pgweb/pkg/command.GitCommit $(GIT_COMMIT) -X github.com/sosedoff/pgweb/pkg/command.BuildTime $(BUILD_TIME)" \
-output="./bin/pgweb_{{.OS}}_{{.Arch}}"
@echo "\nPackaging binaries...\n"
@./script/package.sh
bootstrap:
gox -build-toolchain

14
script/package.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
set -e
DIR="./bin"
rm $DIR/*.zip
for file in $(ls $DIR)
do
fin=$DIR/$file
fout=$DIR/$file.zip
shasum -a 256 $fin
zip -9 -q $fout $fin
done