-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
632be2d
commit bed4b45
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
TAG=`git describe --tag --abbrev=0` | ||
|
||
platforms=( darwin linux freebsd windows openbsd ) | ||
|
||
programs=( crabby ) | ||
|
||
for prog in "${programs[@]}" | ||
do | ||
PROG_WITH_TAG=${prog}-${TAG} | ||
echo "--> Building ${prog}" | ||
for plat in "${platforms[@]}" | ||
do | ||
echo "----> Building for ${plat}/amd64" | ||
if [ "$plat" = "windows" ]; then | ||
GOOS=$plat GOARCH=amd64 go build -o ${PROG_WITH_TAG}-win64.exe | ||
echo "Compressing..." | ||
zip -9 ${PROG_WITH_TAG}-win64.zip ${PROG_WITH_TAG}-win64.exe | ||
mv ${PROG_WITH_TAG}-win64.zip /binaries/${prog}/ | ||
rm ${PROG_WITH_TAG}-win64.exe | ||
else | ||
OUT="${PROG_WITH_TAG}-${plat}-amd64" | ||
GOOS=$plat GOARCH=amd64 go build -o $OUT | ||
echo "Compressing..." | ||
gzip -f $OUT | ||
mv ${OUT}.gz /binaries/${prog}/ | ||
fi | ||
done | ||
|
||
# Build Linux/ARM | ||
echo "----> Building for linux/arm" | ||
OUT="${PROG_WITH_TAG}-linux-arm" | ||
GOOS=linux GOARCH=arm go build -o $OUT | ||
echo "Compressing..." | ||
gzip -f $OUT | ||
mv ${OUT}.gz /binaries/${prog}/ | ||
done |