Skip to main content

Build and Package

In GoFrame, static resources can also be directly packaged into the executable file. When publishing, you only need to provide one executable file.

  • Configuration

hack/config.yaml

gfcli:
build:
name: "hellogf"
arch: "amd64"
system: "linux"
mode: "none"
cgo: 0
packSrc: "manifest/config,resource/public,resource/template"
version: "1.0.0"
output: "./bin"
extra: ""
  • name: The name of the packaged executable file
  • arch: System architecture, can have multiple values separated by commas (,), use all to compile for all supported architectures
  • system: Compilation platform, can have multiple values separated by commas (,), use all to compile for all supported systems
  • packSrc: Directory of static resources to be packaged
  • version: Version number
  • Packaging
gf build

The above operation will package the specified directories into the executable file. Typically, files that need to be modified, such as configuration files, do not need to be packaged into the executable file.