-
Notifications
You must be signed in to change notification settings - Fork 0
Release Pipeline and Versioning
Relevant source files
The following files were used as context for generating this wiki page:
- .github/workflows/ci.yml
- .github/workflows/claude.yml
- .github/workflows/govulncheck.yml
- .github/workflows/hardware-validation.yml
- .github/workflows/refresh-current-state.yml
- .github/workflows/release.yml
- .goreleaser.yml
- IMPROVEMENTS.md
- STRUCTURE.md
- cmd/axis/update.go
- cmd/axis/update_test.go
- docs/architecture.md
- docs/sovereign-grid-architecture.md
- hack/compare-release-versions.go
- internal/execution/integration_test.go
- internal/versioncmp/versioncmp.go
The AXIS release pipeline is a fully automated system designed to produce secure, multi-platform binaries and Software Bill of Materials (SBOMs). It enforces strict synchronization between Git metadata and internal source constants to ensure that the "Truth Rule" extends to the binary's own identity.
The pipeline utilizes GoReleaser for orchestration, syft for SBOM generation, and GitHub Actions for CI/CD gating.
The following diagram illustrates the transition from a Git tag to a published release, highlighting the validation gates and artifact generation.
Title: Release Pipeline Data Flow
graph TD
["git push tag v*.*.*"] --> [".github/workflows/release.yml"]
subgraph "Validation Gates"
[".github/workflows/release.yml"] --> ["Test Gate (go test -race)"]
[".github/workflows/release.yml"] --> ["Security Scan (govulncheck)"]
[".github/workflows/release.yml"] --> ["Version Validation (validate-version)"]
end
["Version Validation (validate-version)"] -- "Matches" --> ["GoReleaser (release job)"]
["Version Validation (validate-version)"] -- "Mismatch" --> ["Pipeline Failure"]
subgraph "Artifact Generation"
["GoReleaser (release job)"] --> ["Multi-platform Binaries (darwin/linux)"]
["GoReleaser (release job)"] --> ["syft (SBOM generation)"]
["GoReleaser (release job)"] --> ["Checksums (sha256sum)"]
end
["Multi-platform Binaries (darwin/linux)"] --> ["GitHub Release Assets"]
["syft (SBOM generation)"] --> ["GitHub Release Assets"]
["Checksums (sha256sum)"] --> ["GitHub Release Assets"]
Sources: .github/workflows/release.yml:11-168, .goreleaser.yml:7-65
AXIS maintains a single source of truth for its versioning. The release pipeline enforces that the Git tag (e.g., v0.10.0) exactly matches the Version constant defined in the source code.
The validate-version job in the release workflow extracts the version string from internal/buildinfo/version.go and compares it against the ${{ github.ref_name }}. If the tag is v0.10.0, the source must contain Version = "0.10.0".
-
Source File:
internal/buildinfo/version.go -
Validation Logic: The pipeline strips the leading
vfrom the tag before comparison .github/workflows/release.yml:123-129. -
Prerelease Detection: Tags containing hyphens (e.g.,
-rc.1) are automatically flagged as prereleases .github/workflows/release.yml:134-138.
GoReleaser injects build-time metadata into the internal/buildinfo package using ldflags. This ensures that axis --version provides accurate provenance data.
| Flag | Variable | Value |
|---|---|---|
-X |
internal/buildinfo.Commit |
Short Git Commit Hash |
-X |
internal/buildinfo.Date |
Build Timestamp |
-X |
internal/buildinfo.GoVersion |
Go Toolchain Version |
Sources: .github/workflows/release.yml:94-139, .goreleaser.yml:24-28
AXIS produces statically linked binaries for darwin and linux on both amd64 and arm64 architectures.
-
SBOM Generation: The pipeline installs
syftto generate a Software Bill of Materials for every archive, providing transparency into the dependency tree .github/workflows/release.yml:182-202. -
Checksums: A
checksums.txtfile is generated using the SHA-256 algorithm, allowing users to verify the integrity of downloaded binaries .goreleaser.yml:52-54. -
Reproducible Builds:
mod_timestampis set to the commit timestamp to aid in build reproducibility .goreleaser.yml:36.
Before a release is finalized, the hardware-validation.yml workflow runs smoke tests on self-hosted runners. This includes:
-
Facts JSON Smoke: Verifying that
axis facts --format jsonproduces valid OS and Architecture fields .github/workflows/hardware-validation.yml:112-119. - Repo Truth Guardrails: Ensuring documentation and code remain in sync .github/workflows/hardware-validation.yml:100-105.
Sources: .goreleaser.yml:29-37, .github/workflows/hardware-validation.yml:30-119
The axis update command provides a built-in mechanism for users to synchronize their local binary with the latest GitHub release.
Title: Update Command Logic
graph TD
["axis update"] --> ["fetchLatestRelease()"]
["fetchLatestRelease()"] --> ["GitHub API (api.github.com)"]
["GitHub API (api.github.com)"] --> ["compareReleaseVersions()"]
subgraph "internal/versioncmp"
["compareReleaseVersions()"] --> ["Version Logic"]
end
["Version Logic"] -- "Newer Available" --> ["installRelease()"]
["Version Logic"] -- "Up to Date" --> ["Exit"]
["Version Logic"] -- "Local is Newer" --> ["Refuse Downgrade"]
subgraph "Installation (installRelease)"
["installRelease()"] --> ["downloadReleaseBinary()"]
["downloadReleaseBinary()"] --> ["verifyChecksum()"]
["verifyChecksum()"] --> ["replaceExecutable()"]
end
-
runUpdate: The main entry point that coordinates version checking and installation .cmd/axis/update.go:81-144. -
findAxisBinaries: Discovers all instances of theaxisbinary in the user'sPATH. If the--allflag is used, it attempts to update every discovered instance .cmd/axis/update.go:153-197. -
replaceExecutable: Performs an in-place binary swap. It is designed to be safe even if the binary is currently running .cmd/axis/update.go:283-305. -
Safety Gating: The updater refuses to perform in-place updates if the binary is managed by a package manager (indicated by
buildinfo.UpdateManagedBy) .cmd/axis/update.go:137-140.
Users can run axis update --check to see if an update is available without performing any filesystem mutations .cmd/axis/update.go:105-121.
Sources: cmd/axis/update.go:47-305, cmd/axis/update_test.go:48-180