chore(workflows): allow release builds without upx

This commit is contained in:
Micheal Wilkinson
2026-03-21 23:00:05 +00:00
parent 6919061240
commit 1ab56b0536
2 changed files with 18 additions and 10 deletions

View File

@@ -43,7 +43,9 @@ jobs:
run: |
set -euo pipefail
apt-get update
apt-get install -y upx-ucl || apt-get install -y upx
if ! apt-get install -y upx-ucl && ! apt-get install -y upx; then
echo "UPX package install failed; release binaries will be uploaded uncompressed." >&2
fi
- name: Validate formatting
run: test -z "$(gofmt -l .)"
@@ -248,13 +250,13 @@ jobs:
run: |
set -euo pipefail
upx_cmd=""
if command -v upx >/dev/null 2>&1; then
upx_cmd=upx
elif command -v upx-ucl >/dev/null 2>&1; then
upx_cmd=upx-ucl
else
echo "UPX is not available on PATH after installation." >&2
exit 1
echo "UPX is not available on PATH; continuing without binary compression." >&2
fi
mkdir -p dist
@@ -265,7 +267,9 @@ jobs:
bin="vociferate_${RELEASE_VERSION}_${os}_${arch}"
GOOS="$os" GOARCH="$arch" go build -trimpath -ldflags="-s -w" -o "dist/${bin}" ./cmd/vociferate
"${upx_cmd}" --best --lzma "dist/${bin}"
if [[ -n "${upx_cmd}" ]]; then
"${upx_cmd}" --best --lzma "dist/${bin}"
fi
done
(
@@ -345,7 +349,7 @@ jobs:
echo "- Tag: ${TAG_NAME}"
echo "- Release notes sourced from changelog entry ${RELEASE_VERSION}."
echo "- Published assets: vociferate_${RELEASE_VERSION}_linux_amd64, vociferate_${RELEASE_VERSION}_linux_arm64, checksums.txt"
echo "- Release binaries were compressed with UPX before upload."
echo "- Release binaries are compressed with UPX when available, otherwise uploaded uncompressed."
} >> "$SUMMARY_FILE"
else
{