chore(workflows): allow release builds without upx
This commit is contained in:
@@ -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
|
||||
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
|
||||
{
|
||||
|
||||
@@ -126,7 +126,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: Preflight release API access
|
||||
env:
|
||||
@@ -170,13 +172,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
|
||||
@@ -187,7 +189,9 @@ jobs:
|
||||
|
||||
bin="vociferate_${RELEASE_VERSION}_${os}_${arch}"
|
||||
GOOS="$os" GOARCH="$arch" go build -trimpath -ldflags="-s -w" -o "dist/${bin}" ./cmd/vociferate
|
||||
if [[ -n "${upx_cmd}" ]]; then
|
||||
"${upx_cmd}" --best --lzma "dist/${bin}"
|
||||
fi
|
||||
done
|
||||
|
||||
(
|
||||
@@ -267,7 +271,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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user