go/docs/cmd/build/example.md
Snider 8601e5b355 docs: add example.md files for all CLI commands
Each command directory now has both index.md (reference) and
example.md (usage examples and configuration samples).

Also adds exception for docs/cmd/build in .gitignore.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 14:58:54 +00:00

1.2 KiB

Build Examples

Quick Start

# Auto-detect and build
core build

# Build for specific platforms
core build --targets linux/amd64,darwin/arm64

# CI mode
core build --ci

Configuration

.core/build.yaml:

version: 1

project:
  name: myapp
  binary: myapp

build:
  main: ./cmd/myapp
  ldflags:
    - -s -w
    - -X main.version={{.Version}}

targets:
  - os: linux
    arch: amd64
  - os: linux
    arch: arm64
  - os: darwin
    arch: arm64

Cross-Platform Build

core build --targets linux/amd64,linux/arm64,darwin/arm64,windows/amd64

Output:

dist/
├── myapp-linux-amd64.tar.gz
├── myapp-linux-arm64.tar.gz
├── myapp-darwin-arm64.tar.gz
├── myapp-windows-amd64.zip
└── CHECKSUMS.txt

Code Signing

sign:
  enabled: true
  gpg:
    key: $GPG_KEY_ID
  macos:
    identity: "Developer ID Application: Your Name (TEAM_ID)"
    notarize: true
    apple_id: $APPLE_ID
    team_id: $APPLE_TEAM_ID
    app_password: $APPLE_APP_PASSWORD

Docker Build

core build --type docker --image ghcr.io/myorg/myapp

Wails Desktop App

core build --type wails --targets darwin/arm64,windows/amd64