GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - gvcgo/gobuilder: An enhancement for official <go build>.

BranchesTags
Open more actions menu

Latest commit

 

History

42 Commits
42 Commits

Folders and files

NameName
Last commit message
Last commit date
build
build
 
 
cmd
cmd
 
 
docs
docs
 
 
internal
internal
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
main.go
main.go
 
 

Repository files navigation

中文 | 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.
  • Cross-compilation for CGO using xgo. (optional)
  • Packs binaries with UPX. (optional)
  • Obfuscate binaries with garble for windows. (optional)
  • Sign windows exe with osslsigncode. (optional)
  • Zip binaries automatically.
  • Builds binaries at anywhere in a go project.
  • Remembers the build operations forever.
  • No script is needed.
  • Keep source code tidy. A dir named build is created, all the related files are restored in build.

Note: You can install upx and go compiler using VMR. osslsigncode needs manuall compilation. garble and xgo can be installed using go install xxx. xgo docker image is available at ghcr.io/crazy-max/xgo or crazymax/xgo.

For self-signed certificate for Windows, see here.

New-SelfSignedCertificate -Type Custom -Subject "CN=<name>, O=<company name>, C=CN, L=<location>, S=<location>" -KeyUsage DigitalSignature -FriendlyName "MailTool" -CertStoreLocation "Cert:\CurrentUser\My" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}") -NotAfter (Get-Date).AddYears(10)

How to use?

  • Install
go install github.com/gvcgo/gobuilder/cmd/[email protected]
  • 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

Demo

compiling vmr for different platforms and architectures.

vmr_compilation

Dependencies

  • go compiler (required)
  • garble (optional)
  • osslsigncode (optional)
  • upx (optional)
  • xgo (optional)

About

An enhancement for official <go build>.

Topics

buildcgocross-compilationcross-compilecross-platformgarblegogolangosslsigncodepackscript-freeupxxgozip

Resources

Readme
MIT license
Activity
Custom properties

Stars

55 stars

Watchers

2 watching

Forks

6 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.