Building and Releasing
Relevant source files
The following files were used as context for generating this wiki page:
- CONTRIBUTING.md
- README.md
- Makefile (referenced in CONTRIBUTING.md and README.md)
- .goreleaser.yaml (referenced in CONTRIBUTING.md)
- cmd/gendocs/main.go
- SECURITY.md
The Daco CLI project employs a structured build and release pipeline designed to ensure cross-platform compatibility, code quality, and automated distribution. The system relies on Go 1.23+, Make for local automation, and GoReleaser integrated with GitHub Actions for formal distribution.
Sources: CONTRIBUTING.md:46-55, README.md:25-45
Development Environment Setup
Before building the project, contributors must configure a local environment that meets specific tool requirements. The project uses a Makefile to standardize setup tasks, including the installation of git hooks and project dependencies.
| Tool | Version | Purpose |
|---|---|---|
| Go | 1.23.0+ | Primary language runtime for building and running the CLI |
| golangci-lint | latest | Static analysis and code linting |
| GoReleaser | v2+ | (Optional) Local testing of release artifacts |
| Make | any | Orchestration of build and test commands |
Sources: CONTRIBUTING.md:46-55, CONTRIBUTING.md:204-215
Initial Setup Workflow
The following diagram illustrates the standard workflow for a developer preparing the environment to build the project.
The setup process ensures that the local environment is consistent with the CI/CD pipeline requirements.
Sources: CONTRIBUTING.md:57-73
Build System
The Daco CLI build system is primarily managed through make targets. The binary entry point is located in cmd/daco/main.go.
Makefile Targets
The project provides several targets to facilitate different stages of the build lifecycle:
make build: Compiles the CLI binary and places it in the localbin/directory.make install: Installs thedacobinary to the user's$GOPATH/bin.make run ARGS="...": Executes the CLI directly without a separate install step, allowing for rapid testing of changes.make clean: Removes temporary build artifacts and thedist/directory.
Sources: CONTRIBUTING.md:100-104, CONTRIBUTING.md:204-215
Documentation Generation
The project includes a specialized tool for generating documentation that is used as part of the build or documentation update process. The cmd/gendocs/main.go command generates LLM-friendly markdown files by introspecting the CLI's command structure.
// cmd/gendocs/main.go:49-65
func main() {
dir := "./docs/cli"
if len(os.Args) > 1 {
dir = os.Args[1]
}
// ... translator registration ...
rootCmd := commands.NewRootCmd(translators)
if err := doc.GenMarkdownTree(rootCmd, dir); err != nil {
fmt.Fprintf(os.Stderr, "error generating docs: %v\n", err)
os.Exit(1)
}
}
Sources: cmd/gendocs/main.go:1-65
Release Process
Releases are managed through GitHub Actions and GoReleaser. The process is categorized into three stages: Local Testing, Continuous Integration, and Formal Release.
Local Release Testing
Developers can simulate a release locally to verify that the GoReleaser configuration is correct and that binaries for different architectures (Linux, Darwin, Windows) are generated properly.
- Command:
make release-snapshot - Output: Check the
dist/directory for generated artifacts.
Sources: CONTRIBUTING.md:118-121, CONTRIBUTING.md:213
CI/CD Pipeline Flow
Formal releases are triggered manually via the GitHub Actions "Release" workflow.
The release workflow manages versioning, artifact creation, and external package manager updates.
Sources: CONTRIBUTING.md:162-180
Versioning Strategy
The project follows a specific naming convention to distinguish between development stages and stable releases.
| Release Type | Version Format | Example | Published to Package Managers |
|---|---|---|---|
| Alpha | X.Y.Z-alpha.N | 0.1.0-alpha.1 | No |
| Beta | X.Y.Z-beta.N | 0.1.0-beta.1 | No |
| Release Candidate | X.Y.Z-rc.N | 0.1.0-rc.1 | No |
| Stable | X.Y.Z | 0.1.0 | Yes (Homebrew/Scoop) |
Sources: CONTRIBUTING.md:182-198, SECURITY.md:5-9
Distribution Channels
Once a release is published, the Daco CLI is available through multiple channels:
- Homebrew: Installed via
brew install dacolabs/tap/daco. - Scoop: Installed by adding the
dacolabsbucket and runningscoop install daco. - Go Install: For developers using
go install github.com/dacolabs/cli/cmd/daco@latest. - GitHub Releases: Direct download of pre-compiled binaries for Linux, macOS, and Windows.
Sources: README.md:11-30, CONTRIBUTING.md:179-180
Summary
The building and releasing infrastructure of the Daco CLI emphasizes automation and platform independence. By utilizing GoReleaser and GitHub Actions, the project maintains a reliable delivery pipeline that supports multiple operating systems while enforcing code quality through mandatory CI checks and conventional commit standards.