runner

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package runner orchestrates the per-module release pipeline: discover -> rewrite -> commit/tag/push -> publish.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModuleResult

type ModuleResult struct {
	Module        string `json:"module"`
	ChangelogPath string `json:"changelog_path"`
	Status        Status `json:"status"`
	NextVersion   string `json:"next_version,omitempty"`
	ReleaseName   string `json:"release_name,omitempty"`
	Bump          string `json:"bump,omitempty"`
	Manual        bool   `json:"manual,omitempty"`
	Error         string `json:"error,omitempty"`
}

ModuleResult captures the outcome of a single module's pipeline.

type Options

type Options struct {
	Config   *config.Config
	Repo     vcs.Repo
	Releaser forge.Releaser
	Logger   *slog.Logger
	Now      func() time.Time
	CI       bool
	Stderr   io.Writer // for raw GitHub Actions group markers
}

Options bundles Runner dependencies.

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner orchestrates a single invocation.

func New

func New(opts Options) *Runner

New constructs a Runner. Config, Repo, and Releaser are required. Logger, Now, and Stderr are optional and default to a stderr logger, time.Now, and os.Stderr respectively, so a zero-valued Logger never causes a nil panic.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context) (*Summary, error)

Run executes the pipeline. It returns a Summary even when an error occurs partway through, so the caller can write a summary file or surface partial-success state.

When SummaryFile is configured, it is written exactly once on every exit path (success, per-module failure, discovery failure, context cancel) so downstream automation can rely on its presence to inspect the run.

type Status

type Status string

Status describes the outcome for a single module.

const (
	StatusReleased Status = "released"
	StatusSkipped  Status = "skipped"
	StatusFailed   Status = "failed"
	StatusDryRun   Status = "dry-run"
)

Module pipeline outcomes.

type Summary

type Summary struct {
	Modules            []ModuleResult `json:"modules"`
	StartedAt          time.Time      `json:"started_at"`
	FinishedAt         time.Time      `json:"finished_at"`
	ReleaseGenVersion  string         `json:"releasegen_version,omitempty"`
	ReleaseGenReleased bool           `json:"releasegen_released"`
}

Summary is the aggregated outcome of an entire run.

Jump to

Keyboard shortcuts

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