generate

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package generate produces CI platform configuration from cidx.toml.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitHub

func GitHub(cfg *config.Config) (string, error)

GitHub generates a GitHub Actions workflow YAML from the CIDX config.

This entrypoint targets external projects: the bootstrap installs cidx via `go install` rather than building from source. Callers that need the cidx-repo bootstrap should use GitHubWithOptions with SelfBuild=true.

func GitHubWithOptions added in v1.7.0

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 GitLab added in v1.4.0

func GitLab(cfg *config.Config) (string, error)

GitLab generates a GitLab CI configuration YAML from the CIDX config.

func IsCidxRepo added in v1.7.0

func IsCidxRepo(dir string) bool

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:

  1. cmd/cidx/main.go must exist
  2. 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 added in v1.7.0

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@latest`.
	SelfBuild bool
}

GitHubOptions controls how the GitHub Actions workflow is generated.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL