Delete build.sh
Browse files
build.sh
DELETED
|
@@ -1,41 +0,0 @@
|
|
| 1 |
-
#!/bin/bash
|
| 2 |
-
|
| 3 |
-
export GOPROXY=https://goproxy.io
|
| 4 |
-
|
| 5 |
-
go get
|
| 6 |
-
|
| 7 |
-
export CGO_ENABLED=0
|
| 8 |
-
PKG=aurora
|
| 9 |
-
|
| 10 |
-
targets=(
|
| 11 |
-
"windows/amd64"
|
| 12 |
-
"linux/amd64"
|
| 13 |
-
"darwin/amd64"
|
| 14 |
-
"windows/386"
|
| 15 |
-
"linux/386"
|
| 16 |
-
"darwin/386"
|
| 17 |
-
"linux/arm"
|
| 18 |
-
"linux/arm64"
|
| 19 |
-
"linux/s390x"
|
| 20 |
-
)
|
| 21 |
-
|
| 22 |
-
upxPath=$(command -v upx)
|
| 23 |
-
|
| 24 |
-
for target in "${targets[@]}"; do
|
| 25 |
-
GOOS=${target%/*}
|
| 26 |
-
GOARCH=${target#*/}
|
| 27 |
-
outputDir="bin/${GOOS}_${GOARCH}"
|
| 28 |
-
outputFile="${outputDir}/${PKG}"
|
| 29 |
-
archiveName="${PKG}-${GOOS}-${GOARCH}.tar.gz"
|
| 30 |
-
mkdir -p $(dirname ${outputFile})
|
| 31 |
-
GOOS=$GOOS GOARCH=$GOARCH go build -ldflags="-s -w -extldflags '-static'" -o ${outputFile} *.go
|
| 32 |
-
if [ -n "$upxPath" ]; then
|
| 33 |
-
$upxPath -9 ${outputFile}
|
| 34 |
-
fi
|
| 35 |
-
# Archive the binary
|
| 36 |
-
if [ "$GOOS" = "windows" ]; then
|
| 37 |
-
zip -j "${outputDir}/${PKG}-${GOOS}-${GOARCH}.zip" "${outputFile}"
|
| 38 |
-
else
|
| 39 |
-
tar -C "${outputDir}" -czf "${outputDir}/${archiveName}" "${PKG}"
|
| 40 |
-
fi
|
| 41 |
-
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|