2022-09-08 15:12:06 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
package_name="roulette"
|
|
|
|
mkdir -p builds
|
|
|
|
|
|
|
|
platforms=(
|
2022-11-11 23:44:05 +00:00
|
|
|
"aix/ppc64"
|
2022-09-08 15:12:06 +00:00
|
|
|
"darwin/amd64"
|
|
|
|
"darwin/arm64"
|
2022-11-11 23:44:05 +00:00
|
|
|
"dragonfly/amd64"
|
|
|
|
"freebsd/386"
|
|
|
|
"freebsd/amd64"
|
|
|
|
"freebsd/arm"
|
|
|
|
"freebsd/arm64"
|
2023-02-06 15:26:54 +00:00
|
|
|
"freebsd/riscv64"
|
2022-11-11 23:44:05 +00:00
|
|
|
"js/wasm"
|
2022-09-08 15:12:06 +00:00
|
|
|
"linux/386"
|
|
|
|
"linux/amd64"
|
|
|
|
"linux/arm"
|
|
|
|
"linux/arm64"
|
2023-09-06 22:51:21 +00:00
|
|
|
"linux/loong64"
|
2022-11-11 23:44:05 +00:00
|
|
|
"linux/mips"
|
|
|
|
"linux/mips64"
|
|
|
|
"linux/mips64le"
|
|
|
|
"linux/mipsle"
|
|
|
|
"linux/ppc64"
|
|
|
|
"linux/ppc64le"
|
|
|
|
"linux/riscv64"
|
|
|
|
"linux/s390x"
|
|
|
|
"netbsd/386"
|
|
|
|
"netbsd/amd64"
|
|
|
|
"netbsd/arm"
|
|
|
|
"netbsd/arm64"
|
|
|
|
"openbsd/mips64"
|
2023-09-06 22:51:21 +00:00
|
|
|
"wasip1/wasm"
|
2022-10-23 21:49:32 +00:00
|
|
|
"windows/386"
|
|
|
|
"windows/amd64"
|
2022-11-11 23:44:05 +00:00
|
|
|
"windows/arm"
|
|
|
|
"windows/arm64"
|
2022-09-08 15:12:06 +00:00
|
|
|
)
|
|
|
|
|
2022-09-22 04:15:45 +00:00
|
|
|
for platform in "${platforms[@]}"; do
|
|
|
|
IFS=" " read -r -a platform_split <<< "${platform//\// }"
|
2022-09-08 15:12:06 +00:00
|
|
|
GOOS="${platform_split[0]}"
|
|
|
|
GOARCH="${platform_split[1]}"
|
|
|
|
output_name="${package_name}-${GOOS}-${GOARCH}"
|
|
|
|
ld_flags='-s -w'
|
2022-10-23 21:49:32 +00:00
|
|
|
if [ "${GOOS}" == "windows" ]; then
|
|
|
|
output_name+=".exe"
|
2022-09-08 15:12:06 +00:00
|
|
|
fi
|
2023-08-31 02:09:10 +00:00
|
|
|
env GOOS="${GOOS}" GOARCH="${GOARCH}" CC="musl-gcc" CGO_ENABLED=0 go build -trimpath -ldflags "${ld_flags}" -o "builds/${output_name}"
|
2022-09-08 15:12:06 +00:00
|
|
|
done
|