-
Notifications
You must be signed in to change notification settings - Fork 9
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
Showing
2 changed files
with
23 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 |
---|---|---|
|
@@ -13,3 +13,6 @@ | |
|
||
# Ignore vendor directory | ||
vendor/ | ||
|
||
# Ignore dist binaries | ||
/dist/ |
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,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 |