1
Home
Virgil edited this page 2026-03-11 12:03:21 +00:00
Table of Contents
go-build
Module: forge.lthn.ai/core/go-build
Build system, release automation, and SDK generation for the Core ecosystem. Replaces goreleaser with a native Go implementation supporting 8 builder types and 8 release publishers. Configuration via .core/build.yaml and .core/release.yaml.
Architecture
Three packages under pkg/:
| Package | Purpose |
|---|---|
pkg/build |
Project type detection, cross-compilation, archiving, checksums, code signing |
pkg/release |
Release orchestration, changelog generation, version detection, publishing |
pkg/sdk |
OpenAPI spec detection, SDK generation (TypeScript, Python, Go, PHP), breaking change detection |
CLI commands in cmd/build/ and cmd/ci/ register with the core CLI.
Key Types
pkg/build
Builderinterface —Name(),Detect(),Build(). Implementations:GoBuilder,WailsBuilder,DockerBuilder,LinuxKitBuilder,CppBuilder,TaskfileBuilderProjectType— Constants:ProjectTypeGo,ProjectTypeWails,ProjectTypeNode,ProjectTypePHP,ProjectTypeCPP,ProjectTypeDocker,ProjectTypeLinuxKit,ProjectTypeTaskfileConfig— Runtime build parameters:FS,ProjectDir,OutputDir,Name,Version,LDFlags, Docker/LinuxKit fieldsBuildConfig— Loaded from.core/build.yaml:Project,Build,Targets,SignTarget—OS string,Arch stringArtifact— Build output:Path,OS,Arch,Checksum
pkg/release
Release— Version, artifacts, changelog, project directoryConfig— Release configuration with publishers listPublisherinterface (inpublishers/) —Name(),Publish(). Implementations: GitHub, Docker, npm, Homebrew, Scoop, AUR, Chocolatey, LinuxKit
pkg/sdk
SDK— Orchestrates OpenAPI SDK generationConfig— Languages, output dir, package naming, diff settings, publish configGeneratorinterface (ingenerators/) — TypeScript, Python, Go, PHP generators
Usage
import "forge.lthn.ai/core/go-build/pkg/build"
// Detect project type
types, _ := build.Discover(io.Local, ".")
primary, _ := build.PrimaryType(io.Local, ".")
// Load build config
cfg, _ := build.LoadConfig(io.Local, ".")
// Build with Go builder
builder := builders.NewGoBuilder()
artifacts, _ := builder.Build(ctx, &build.Config{...}, targets)
Dependencies
forge.lthn.ai/core/go-io— File I/O abstractiongopkg.in/yaml.v3— YAML config parsing