Build configuration examples for testing and documentation: - build-minimal.yaml - Auto-detect everything - build-go-cli.yaml - Cross-platform CLI - build-go-wails.yaml - Desktop app with frontend - build-go-library.yaml - Library (no binary) - build-docker.yaml - Multi-arch container - build-docker-go.yaml - Go binary + Docker - build-linuxkit.yaml - Immutable Linux images - build-php-laravel.yaml - FrankenPHP + Laravel - build-multi-binary.yaml - Multiple binaries - build-full.yaml - All available options Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
121 lines
2 KiB
YAML
121 lines
2 KiB
YAML
# Example: Full Build Configuration
|
|
# All available options
|
|
|
|
version: 1
|
|
|
|
project:
|
|
name: myapp
|
|
binary: myapp
|
|
type: auto # auto, go, wails, docker, linuxkit, php
|
|
|
|
build:
|
|
# Go build settings
|
|
main: ./cmd/myapp
|
|
|
|
# Environment variables
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
GOFLAGS: "-mod=readonly"
|
|
|
|
# Build flags
|
|
flags:
|
|
- -trimpath
|
|
- -v
|
|
|
|
# Linker flags
|
|
ldflags:
|
|
- -s -w
|
|
- -X main.version={{.Version}}
|
|
- -X main.commit={{.Commit}}
|
|
- -X main.date={{.Date}}
|
|
- -X main.builtBy=core
|
|
|
|
# Build tags
|
|
tags:
|
|
- production
|
|
- netgo
|
|
|
|
# Build targets
|
|
targets:
|
|
- os: linux
|
|
arch: amd64
|
|
- os: linux
|
|
arch: arm64
|
|
- os: linux
|
|
arch: "386"
|
|
- os: darwin
|
|
arch: amd64
|
|
- os: darwin
|
|
arch: arm64
|
|
- os: windows
|
|
arch: amd64
|
|
- os: windows
|
|
arch: arm64
|
|
- os: freebsd
|
|
arch: amd64
|
|
|
|
# Wails configuration (if type: wails)
|
|
wails:
|
|
frontend: ./frontend
|
|
install_cmd: install
|
|
build_cmd: build
|
|
dev_cmd: dev
|
|
|
|
# Docker configuration (if type: docker or docker output enabled)
|
|
docker:
|
|
dockerfile: Dockerfile
|
|
context: .
|
|
registry: ghcr.io
|
|
image: myorg/myapp
|
|
platforms:
|
|
- linux/amd64
|
|
- linux/arm64
|
|
tags:
|
|
- latest
|
|
- "{{.Version}}"
|
|
build_args:
|
|
VERSION: "{{.Version}}"
|
|
labels:
|
|
org.opencontainers.image.source: https://github.com/myorg/myapp
|
|
target: production
|
|
cache:
|
|
from: type=gha
|
|
to: type=gha,mode=max
|
|
|
|
# LinuxKit configuration (if type: linuxkit)
|
|
linuxkit:
|
|
config: .core/linuxkit/server.yml
|
|
formats:
|
|
- iso
|
|
- qcow2
|
|
- docker
|
|
platforms:
|
|
- linux/amd64
|
|
- linux/arm64
|
|
|
|
# Archive settings
|
|
archive:
|
|
format: tar.gz
|
|
format_windows: zip
|
|
name: "{{.Project}}-{{.Version}}-{{.OS}}-{{.Arch}}"
|
|
files:
|
|
- LICENSE
|
|
- README.md
|
|
- CHANGELOG.md
|
|
strip_parent: true
|
|
|
|
# Checksum settings
|
|
checksum:
|
|
algorithm: sha256
|
|
file: checksums.txt
|
|
|
|
# Hooks
|
|
hooks:
|
|
pre_build:
|
|
- go generate ./...
|
|
- go mod tidy
|
|
post_build:
|
|
- echo "Build complete"
|
|
|
|
# Output directory
|
|
output: dist
|