build smaller release binaries

This commit is contained in:
Jeff Carr 2025-09-25 05:03:46 -05:00
parent dada18c9a1
commit d07ba68cd1
1 changed files with 5 additions and 1 deletions

View File

@ -104,7 +104,11 @@ func buildPackage(repo *gitpb.Repo) (bool, error) {
datestamp := now.UTC().Format("2006/01/02_1504_UTC")
log.Info("datestamp =", datestamp)
// add some standard golang flags
ldflags := "-X main.VERSION=" + version + " "
var ldflags string
if argv.Release {
ldflags += "-s -w "
}
ldflags += "-X main.VERSION=" + version + " "
ldflags += "-X main.BUILDTIME=" + datestamp + " "
ldflags += "-X main.GUIVERSION=" + version + "" // todo: git this from the filesystem
cmd = append(cmd, "-ldflags", ldflags)