diff --git a/Makefile b/Makefile index b37abbb..005beb4 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/script/package.sh b/script/package.sh new file mode 100755 index 0000000..6b3f9c1 --- /dev/null +++ b/script/package.sh @@ -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 \ No newline at end of file