chore(release): add UPX compression for linux artifacts

This commit is contained in:
Micheal Wilkinson
2026-03-20 14:46:54 +00:00
parent 8fc831dfdf
commit c3f809a586

View File

@@ -39,11 +39,26 @@ jobs:
cache: true cache: true
cache-dependency-path: go.sum cache-dependency-path: go.sum
- name: Install UPX
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- name: Build binary - name: Build binary
run: | run: |
mkdir -p dist mkdir -p dist
output="dist/gosick_${{ matrix.goos }}_${{ matrix.goarch }}"
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_ENABLED=0 \ GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_ENABLED=0 \
go build -o dist/gosick_${{ matrix.goos }}_${{ matrix.goarch }} ./cmd/homesick go build -o "$output" ./cmd/homesick
- name: Compress binary with UPX
if: ${{ matrix.goos == 'linux' }}
run: |
set -euo pipefail
output="dist/gosick_${{ matrix.goos }}_${{ matrix.goarch }}"
if ! upx --best --lzma "$output"; then
echo "::warning::UPX compression failed for ${output}; continuing with uncompressed binary"
fi
- name: Package artifact - name: Package artifact
run: | run: |