gobuilder

command module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 2 Imported by: 0

README

中文 | En

What's gobuilder?

Gobuilder is a tool for building Go binaries. It is similar to the Go tool, but it supports building multiple binaries at once and supports custom build configurations without creating any script.

Features

  • Builds binaries for any platform from go source code.
  • Packs binaries with UPX.
  • Obfuscate binaries with garble for windows.
  • Sign windows exe with osslsigncode.
  • Zip binaries automatically.
  • Builds binaries at anywhere in a go project.
  • Remembers the build operations forever.
  • No script is needed.

Note:if you wanna sign windows binaries with osslsigncode, you will need to manually add following fields to build/gbuild.json for gobuilder:

// Example:
{
    "osslsigncode": true,
    "pfx_file_path":"/home/moqsien/golang/src/gvcgo/version-manager/scripts/vmr.pfx",
    "pfx_password":"Vmr2024",
    "pfx_company":"GVC",
    "pfx_website":"https://github.com/gvcgo/",
}

How to use?

  • Install
go install github.com/gvcgo/gobuilder/cmd/gber@v0.1.3
  • Usage
gber build <your-go-build-flags-and-args>

Note: If you need to inject variables when building go source code, "$" should be replaced with "#".

# original
gber build -ldflags "-X main.GitTag=$(git describe --abbrev=0 --tags) -X main.GitHash=$(git show -s --format=%H)  -s -w" ./cmd/vmr/

# replaced
gber build -ldflags "-X main.GitTag=#(git describe --abbrev=0 --tags) -X main.GitHash=#(git show -s --format=%H)  -s -w" ./cmd/vmr

Dependencies

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL