dist.sh: use go build option to strip binaries
30% release binary size reduction
This commit is contained in:
parent
d7e327d712
commit
68e3178812
3
dist.sh
3
dist.sh
@ -25,7 +25,8 @@ for os in windows linux darwin; do
|
||||
fi
|
||||
BUILD=$(mktemp -d ${TMPDIR:-/tmp}/oauth2_proxy.XXXXXX)
|
||||
TARGET="oauth2_proxy-$version.$os-$arch.$goversion"
|
||||
GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -o $BUILD/$TARGET/oauth2_proxy$EXT || exit 1
|
||||
GOOS=$os GOARCH=$arch CGO_ENABLED=0 \
|
||||
go build -ldflags="-s -w" -o $BUILD/$TARGET/oauth2_proxy$EXT || exit 1
|
||||
pushd $BUILD
|
||||
tar czvf $TARGET.tar.gz $TARGET
|
||||
mv $TARGET.tar.gz $DIR/dist
|
||||
|
Loading…
Reference in New Issue
Block a user