Add upx to goreleaser builds

Reducing the size of the final binaries, except for darwin, where the
packed binaries failed to run.
This commit is contained in:
Cuong Manh Le
2023-02-10 11:11:40 +07:00
committed by Cuong Manh Le
parent a08b39be16
commit f13f61592c
2 changed files with 9 additions and 0 deletions

View File

@@ -25,6 +25,8 @@ builds:
gomips:
- softfloat
main: ./cmd/ctrld
hooks:
post: /bin/sh ./scripts/upx.sh
archives:
- format_overrides:
- goos: windows

7
scripts/upx.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -ex
for dist_dir in ./dist/ctrld*; do
upx --brute "${dist_dir}/ctrld"
done