diff --git a/scripts/build.sh b/scripts/build.sh index dc48240..3286cfa 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,14 +2,18 @@ set -euo pipefail GOMOD=$(head -1 go.mod | awk '{print $2}') +GOOS="linux" go build -ldflags='-s -w' -o "linux/amd64/bin/helper" "$GOMOD/cmd/helper" +GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o "linux/arm64/bin/helper" "$GOMOD/cmd/helper" GOOS="linux" go build -ldflags='-s -w' -o linux/amd64/bin/main "$GOMOD/cmd/main" GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o linux/arm64/bin/main "$GOMOD/cmd/main" if [ "${STRIP:-false}" != "false" ]; then + strip linux/amd64/bin/helper linux/arm64/bin/helper strip linux/amd64/bin/main linux/arm64/bin/main fi if [ "${COMPRESS:-none}" != "none" ]; then + $COMPRESS linux/amd64/bin/helper linux/arm64/bin/helper $COMPRESS linux/amd64/bin/main linux/arm64/bin/main fi