mirror of
https://github.com/cunnie/sslip.io.git
synced 2025-09-27 03:55:56 +08:00
24 lines
671 B
Bash
Executable File
24 lines
671 B
Bash
Executable File
#!/bin/bash -x
|
|
#
|
|
# Build binaries for macOS, Windows, Linux, FreeBSD
|
|
#
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
cd $DIR/..
|
|
ldflags="-X xip/xip.VersionSemantic=5.0.0 \
|
|
-X xip/xip.VersionDate=$(date +%Y/%m/%d-%H:%M:%S%z) \
|
|
-X xip/xip.VersionGitHash=$(git rev-parse --short HEAD)"
|
|
export GOOS GOARCH
|
|
|
|
# Bring in ARM64 for my AWS Graviton2 instance
|
|
for GOARCH in amd64 arm64; do
|
|
for GOOS in darwin linux freebsd; do
|
|
go build \
|
|
-ldflags="$ldflags" \
|
|
-o $DIR/sslip.io-dns-server-$GOOS-$GOARCH \
|
|
main.go &
|
|
done
|
|
GOOS=windows
|
|
go build -o $DIR/sslip.io-dns-server-$GOOS-$GOARCH.exe main.go &
|
|
done
|
|
wait
|