13 lines
515 B
Bash
Executable File
13 lines
515 B
Bash
Executable File
#!/usr/bin/env sh
|
|
# Compila realconn para varios sistemas operativos en ./dist
|
|
set -e
|
|
VERSION=${VERSION:-$(date +%Y.%m.%d)}
|
|
TARGETS=${TARGETS:-"linux/amd64 linux/arm64 linux/arm windows/amd64 windows/arm64 darwin/amd64 darwin/arm64 freebsd/amd64"}
|
|
mkdir -p dist
|
|
for t in $TARGETS; do
|
|
os=${t%/*}; arch=${t#*/}
|
|
out="dist/realconn-$os-$arch"; [ "$os" = windows ] && out="$out.exe"
|
|
echo "-> $out"
|
|
CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -trimpath -ldflags "-s -w -X main.version=$VERSION" -o "$out" .
|
|
done
|