Add freebsd to goreleaser config

While at it, fixed the hook upx script to run per file, and ignore
binaries which are not supported.
This commit is contained in:
Cuong Manh Le
2023-02-27 21:25:07 +07:00
committed by Cuong Manh Le
parent 14bc29751f
commit 0dfa377e08
2 changed files with 25 additions and 4 deletions

View File

@@ -2,6 +2,22 @@
set -ex
for dist_dir in ./dist/ctrld*; do
upx --brute "${dist_dir}/ctrld"
done
binary=$1
if [ -z "$binary" ]; then
echo >&2 "Usage: $0 <binary>"
exit 1
fi
case "$binary" in
*_freebsd_*)
echo >&2 "upx does not work with freebsd binary yet"
exit 0
;;
*_windows_arm*)
echo >&2 "upx does not work with windows arm/arm64 binary yet"
exit 0
;;
esac
upx -- "$binary"