GO + X (crossbuild) + Z (zip)
Just do cross building and archiving go tools conventionally
% go install github.com/Songmu/goxz/cmd/goxz@latest
Built binaries are available on gihub releases. https://github.com/Songmu/goxz/releases
You can also install goxz with aqua.
% aqua g -i Songmu/goxz
goxc
subset
# in your repository
% goxz -pv 0.0.1 -os=linux,darwin -arch=amd64 ./cmd/mytool [...]
# archives are built into `./goxz` directory by default (configurable by `-d` option)
% tree ./goxz
goxz/
├── yourapp_0.0.1_darwin_amd64.zip
└── ...
following files are included to archives automatically.
LICENSE*
README*
INSTALL*
CREDIT*
CHANGELOG*
You can specify additional resources by using -include
option.
{{Package}}_{{Version}}_{{OS}}_{{Arch}}.{{Ext}}
or
{{Package}}_{{OS}}_{{Arch}}.{{Ext}}
{{Package}}
-n
option{{Version}}
-pv
option, that is contained in archive name{{Ext}}
.zip
is by default on "windows" and "darwin", .tar.gz
is by default on other os.-z
option to use zip always to compress.{{.ExeName}}_{{.Version}}_{{.Os}}_{{.Arch}}{{.Ext}}
-d
destination directory (./goxz
by default)-n
application name. by default the directory name is used.-os
linux,darwin and windows by default-arch
amd64,arm64 by default-pv
for speicifing version (optional)-o
output filename
-z
to use zip always to compless
-include
Include additional resources in archives-build-ldflags
/ -build-tags