From 4b4b330341ecef15a36d049ae63ac333d42e3465 Mon Sep 17 00:00:00 2001 From: boyska Date: Tue, 28 May 2019 20:43:35 +0200 Subject: [PATCH] release bash script --- makebin.sh | 13 +++++++++++++ makezip.sh | 8 ++++++++ release.sh | 17 +++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100755 makebin.sh create mode 100755 makezip.sh create mode 100755 release.sh diff --git a/makebin.sh b/makebin.sh new file mode 100755 index 0000000..0452a8d --- /dev/null +++ b/makebin.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -u + +for goosarch in $(go tool dist list | grep -vw -e aix -e js/wasm -e plan9 -e solaris -e android -e nacl) +do + mkdir -p "build/$goosarch" + goos=$(cut -d/ -f 1 <<<$goosarch) + goarch=$(cut -d/ -f 2 <<<$goosarch) + for cmd in cmd/*; do + GOOS=${goos} GOARCH=${goarch} go build -o "build/$goos/$goarch/$(basename $cmd)" ./$cmd + done +done diff --git a/makezip.sh b/makezip.sh new file mode 100755 index 0000000..7dca798 --- /dev/null +++ b/makezip.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +find build/ -type f|cut -d/ -f 1-3|uniq|while read -r dir; do + zip -j -r "circolog-$(git describe)-$(cut -d/ -f 2-3 <<<"$dir"|tr / -)" "$dir" +done + +wait + diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..0c15d89 --- /dev/null +++ b/release.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -u + +for goosarch in $(go tool dist list | grep -vw -e aix -e js/wasm -e plan9 -e solaris -e android -e nacl) +do + mkdir -p "build/$goosarch" + goos=$(cut -d/ -f 1 <<<$goosarch) + goarch=$(cut -d/ -f 2 <<<$goosarch) + for cmd in cmd/*; do + GOOS=${goos} GOARCH=${goarch} go build -o "build/$goos/$goarch/$(basename $cmd)" ./$cmd + done +done + +find build/ -type f|cut -d/ -f 1-3|uniq|while read -r dir; do + zip -j -r "circolog-$(git describe)-$(cut -d/ -f 2-3 <<<"$dir"|tr / -)" "$dir" +done