From c46d52b11acd43a58ca46d4e13bd19bdd3006c8d Mon Sep 17 00:00:00 2001 From: Dustin Decker Date: Thu, 17 Oct 2024 08:04:37 -0700 Subject: [PATCH] Compress release with UPX (#3445) --- .github/workflows/release.yml | 4 ++++ .goreleaser.yml | 3 +++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33c86fd6a8b8..db77574b4de1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,6 +39,10 @@ jobs: go-version: "1.23" - name: Cosign install uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0 + - name: Install UPX + run: | + sudo apt-get update + sudo apt-get install -y upx - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index 77bc73d8cf0a..6fca8511fdc0 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -11,6 +11,9 @@ builds: goarch: - amd64 - arm64 + hooks: + post: + - bash -c 'if [ "{{ .Env.GGOOS }}" != "darwin" ]; then upx -q "{{ .Path }}"; fi' dockers: - image_templates: ["trufflesecurity/{{ .ProjectName }}:{{ .Version }}-amd64"] dockerfile: Dockerfile.goreleaser