Skip to content

Commit

Permalink
Compress release with UPX (#3456)
Browse files Browse the repository at this point in the history
* Compress release with UPX

* Allow UPX to fail, and use goreleaser-pro

* update
  • Loading branch information
dustin-decker authored Feb 5, 2025
1 parent e68e671 commit f19d6e5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,17 @@ 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:
distribution: goreleaser
distribution: goreleaser-pro
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
17 changes: 15 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
version: 2
builds:
- binary: trufflehog
- id: trufflehog-upx
binary: trufflehog
ldflags:
- -s -w -X 'github.com/trufflesecurity/trufflehog/v3/pkg/version.BuildVersion={{ .Version }}'
env: [CGO_ENABLED=0]
goos:
- linux
- windows
goarch:
- amd64
- arm64
hooks:
post:
- upx -q "{{ .Path }}"
- id: trufflehog
binary: trufflehog
ldflags:
- -X 'github.com/trufflesecurity/trufflehog/v3/pkg/version.BuildVersion={{ .Version }}'
env: [CGO_ENABLED=0]
goos:
- darwin
- windows
goarch:
- amd64
- arm64
Expand Down

0 comments on commit f19d6e5

Please sign in to comment.