diff options
author | Teddy Wing | 2017-06-04 03:24:04 +0200 |
---|---|---|
committer | Teddy Wing | 2017-06-04 03:24:04 +0200 |
commit | 9824ac194096d53191bd54f02f0a64d022a07d0d (patch) | |
tree | 4255a5cac1c3da158372fe279ff949b63c5374af | |
parent | 716e07e59917a4561a6c8d719f54f1854aefd5c4 (diff) | |
download | timetasker-9824ac194096d53191bd54f02f0a64d022a07d0d.tar.bz2 |
Add release.sh script
Compiles and compresses builds for a number of different platforms,
placing them all in a dist/ directory for release.
-rw-r--r-- | release.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/release.sh b/release.sh new file mode 100644 index 0000000..d783555 --- /dev/null +++ b/release.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +mkdir -p dist + +TARGETS=" + darwin-amd64 + freebsd-386 + freebsd-amd64 + freebsd-arm + linux-386 + linux-amd64 + linux-arm + linux-arm64 + linux-ppc64 + openbsd-386 + openbsd-amd64 + openbsd-arm +" + +# Remove empty lines and indentation +TARGETS=$(echo "$TARGETS" | sed -e '/^$/d' -e 's/ //') + +for target in $TARGETS; do + os=$(echo "$target" | cut -d'-' -f 1 -) + arch=$(echo "$target" | cut -d'-' -f 2 -) + + GOOS="$os" \ + GOARCH="$arch" \ + go build -v + + tar cjvf "timetasker_${os}_${arch}.tar.bz2" timetasker + mv "timetasker_${os}_${arch}.tar.bz2" dist +done |