Files
eiblog/scripts/dist_tar.sh
2025-07-17 15:37:30 +08:00

18 lines
384 B
Bash
Executable File

#!/usr/bin/env sh
set -e
_tag="$1"
_arch=$(go env GOARCH)
for file in cmd/*; do
app="$(basename $file)";
# tar platform
for os in linux darwin windows; do
_target="$app-$_tag.$os-$_arch.tar.gz"
GOOS=$os GOARCH=$_arch \
go build -ldflags '-extldflags "-static"' -o ./cmd/$app/backend ./cmd/$app
tar czf $_target ./cmd/$app/etc ./cmd/$app/backend
done
done