feat(*): add `upx --best` for most elf

This commit is contained in:
dawnnnnnn 2021-12-06 17:42:25 +08:00
parent b93df1ab20
commit bd0bcb4b66
2 changed files with 33 additions and 7 deletions

View File

@ -1,13 +1,10 @@
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- id: "with-upx"
env:
- CGO_ENABLED=0
goos:
- linux
@ -18,7 +15,6 @@ builds:
- arm64
- arm
- "386"
- mips64
goarm:
- "6"
- "7"
@ -29,6 +25,35 @@ builds:
ignore:
- goos: windows
goarch: arm64
- goos: windows
goarch: arm
- goos: linux
goarch: mips64
hooks:
post: upx --best -f -q "{{ .Path }}"
# UnknownExecutableFormatException
# CantPackException: can't pack new-exe
- id: "without-upx"
env:
- CGO_ENABLED=0
goos:
- linux
- windows
goarch:
- mips64
- arm
goarm:
- "6"
- "7"
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser
ignore:
- goos: linux
goarch: arm
archives:
- replacements:
darwin: Darwin

View File

@ -11,6 +11,7 @@ permissions:
jobs:
goreleaser:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
-
name: Checkout
@ -28,7 +29,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: --rm-dist -f .github/conf/.goreleaser.yml
args: -f .github/conf/.goreleaser.yml
workdir: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}