Skip to content

Commit

Permalink
Script to build all releases.
Browse files Browse the repository at this point in the history
  • Loading branch information
navossoc committed Dec 29, 2018
1 parent 3b7486a commit ed91b0a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@

# Ignore vendor directory
vendor/

# Ignore dist binaries
/dist/
20 changes: 20 additions & 0 deletions build-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# Reference: https://github.com/containous/traefik/blob/master/script/crossbinary-default

set -e
mkdir -p dist

GO_BUILD_CMD="go build"

OS_PLATFORM_ARG=(linux windows darwin)
OS_ARCH_ARG=(amd64 386)
for OS in ${OS_PLATFORM_ARG[@]}; do
BIN_EXT=''
if [ "$OS" == "windows" ]; then
BIN_EXT='.exe'
fi
for ARCH in ${OS_ARCH_ARG[@]}; do
echo "Building binary for ${OS}/${ARCH}..."
GOARCH=${ARCH} GOOS=${OS} CGO_ENABLED=0 ${GO_BUILD_CMD} -o "dist/MuError_${OS}-${ARCH}${BIN_EXT}" .
done
done

0 comments on commit ed91b0a

Please sign in to comment.