chore(release): add UPX compression for linux artifacts
This commit is contained in:
@@ -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: |
|
||||||
|
|||||||
Reference in New Issue
Block a user