From c3f809a586dcdb41a78f49be0b7b7de07b23d780 Mon Sep 17 00:00:00 2001 From: Micheal Wilkinson Date: Fri, 20 Mar 2026 14:46:54 +0000 Subject: [PATCH] chore(release): add UPX compression for linux artifacts --- .gitea/workflows/tag-build-artifacts.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/tag-build-artifacts.yml b/.gitea/workflows/tag-build-artifacts.yml index 9cf41af..f5c7ecf 100644 --- a/.gitea/workflows/tag-build-artifacts.yml +++ b/.gitea/workflows/tag-build-artifacts.yml @@ -39,11 +39,26 @@ jobs: cache: true cache-dependency-path: go.sum + - name: Install UPX + uses: crazy-max/ghaction-upx@v3 + with: + install-only: true + - name: Build binary run: | mkdir -p dist + output="dist/gosick_${{ matrix.goos }}_${{ matrix.goarch }}" 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 run: |