1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-25 21:29:14 +02:00
Carlos Alexandro Becker 43ae761179
feat: native upx support (#3965)
this adds a new root-level `upx` config, so users can pack their
binaries with upx :)

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-05-01 21:22:05 -03:00

855 B

UPX

Since: v1.18

Having small binary sizes are important, and Go is known for generating rather big binaries.

GoReleaser has had -s -w as default ldflags since the beginning, which help shaving off some bytes, but if you want to shave it even more, upx is the de facto tool for the job.

GoReleaser has been able to integrate with it via custom [build hooks][bhooks], and now UPX has its own configuration section:

# .goreleaser.yaml
upx:
  -
    # Whether to enable it or not.
    enabled: true

    # Filter by build ID.
    ids: [ build1, build2 ]

    # Compress argument.
    # Valid options are from '1' (faster) to '9' (better), and 'best'.
    compress: best

    # Whether to try LZMA (slower).
    lzma: true

    # Whether to try all methods and filters (slow).
    brute: true