Documentation
¶
Overview ¶
Package generate produces CI platform configuration from cidx.toml.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version = "dev"
Version is the cidx build version, propagated from main at startup (same pattern as executor.Version). Release builds inject it via ldflags (`-X main.Version=1.7.0`); dev builds keep the "dev" default.
It determines the bootstrap pin in generated workflows: a workflow generated by a released cidx installs that exact release in CI, so local and CI runs use the same presets (issue #163).
Functions ¶
func BootstrapVersion ¶
func BootstrapVersion() string
BootstrapVersion returns the `go install` version suffix used by generated workflows: "v<X.Y.Z>" when the running cidx is a release build, "latest" otherwise (dev or nightly builds, which have no installable tag).
func GitHub ¶
GitHub generates a GitHub Actions workflow YAML from the CIDX config.
This entrypoint targets external projects: the bootstrap installs cidx via `go install`, pinned to the generating cidx's release version when known (see BootstrapVersion). Callers that need the cidx-repo bootstrap should use GitHubWithOptions with SelfBuild=true.
func GitHubWithOptions ¶
func GitHubWithOptions(cfg *config.Config, opts GitHubOptions) (string, error)
GitHubWithOptions generates a GitHub Actions workflow YAML with explicit generation options. Use this when you need to control the bootstrap mode (self-build vs. go-install) directly.
func IsCidxRepo ¶
IsCidxRepo reports whether dir is the cidx repository itself.
The check has two prongs to avoid false positives from any project that happens to have a cmd/cidx/ directory:
- cmd/cidx/main.go must exist
- go.mod's module declaration must equal the canonical cidx module path
Returns false on any I/O error or missing marker — external project semantics are the safe default.
Types ¶
type GitHubOptions ¶
type GitHubOptions struct {
// SelfBuild emits the cidx-repo bootstrap (`go build -o bin/cidx ./cmd/cidx`).
// When false (the default for external projects), the bootstrap installs
// cidx via `go install <module>/cmd/cidx@<BootstrapVersion()>`.
SelfBuild bool
}
GitHubOptions controls how the GitHub Actions workflow is generated.