23 lines
763 B
Bash
23 lines
763 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
export GOTOOLCHAIN=local
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")/.."
|
|
go env -w GOPROXY=https://goproxy.cn,direct
|
|
go env -w GOSUMDB=off
|
|
mkdir -p dist
|
|
|
|
echo "Building macOS arm64..."
|
|
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o dist/juku_darwin_arm64 .
|
|
|
|
echo "Building macOS amd64..."
|
|
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o dist/juku_darwin_amd64 .
|
|
|
|
echo "Building Linux amd64..."
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o dist/juku_linux_amd64 .
|
|
|
|
echo "Building Windows amd64..."
|
|
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o dist/juku_windows_amd64.exe .
|
|
|
|
echo "Done. Files are in dist/."
|