cross compile quic-go for all platforms / architectures

This commit is contained in:
Marten Seemann
2020-11-18 18:35:52 +07:00
parent 69158cf5f1
commit db5e6f61e5
2 changed files with 36 additions and 0 deletions

17
.github/workflows/cross-compile.sh vendored Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
set -e
GOVERSION=$(go version | cut -d " " -f 3 | cut -b 3-6)
for dist in $(go tool dist list); do
goos=$(echo $dist | cut -d "/" -f1)
goarch=$(echo $dist | cut -d "/" -f2)
if [[ "$goos" == "android" ]]; then continue; fi # cross-compiling for android is a pain...
if [[ "$goos" == "darwin" && $goarch == "arm64" ]]; then continue; fi # ... darwin/arm64 neither
if [[ $GOVERSION == "1.14" && $goos == "darwin" && $goarch == "arm" ]]; then continue; fi # Go 1.14 lacks syscall.IPV6_RECVTCLASS
echo "$dist"
GOOS=$goos GOARCH=$goarch go build -o main example/main.go
rm main
done