build: optimize binary size and improve test accuracy

- Add a post-build hook to compress the generated binary with `xz` at level 9 compression

Signed-off-by: appleboy <appleboy.tw@gmail.com>
This commit is contained in:
appleboy 2023-05-06 07:57:07 +08:00
parent a7c7568d70
commit 0a721bdfff
1 changed files with 4 additions and 0 deletions

View File

@ -71,6 +71,10 @@ builds:
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}-{{ .Arm }}{{ end }}
no_unique_dist_dir: true
hooks:
post:
- cmd: xz -k -9 {{ .Path }}
dir: ./dist/
archives:
- format: binary