announce

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package announce implements the `announce` verb: tell people a release happened, through the adapters .colophon.yaml configures.

Index

Constants

This section is empty.

Variables

View Source
var DefaultAuthor = object.Signature{Name: "colophon", Email: "colophon@phpboyscout.uk"}

DefaultAuthor is attributed to a commit an adapter makes when the verb running it has no author flags of its own (`release`).

View Source
var ErrAnnouncementFailed = errors.New("announce")

ErrAnnouncementFailed reports a run whose release stood and whose announcing did not all go out, when --announce-failure-exit asked to hear about it (spec 0028).

View Source
var ErrBadFailureExit = errorhandling.WithOutcome(
	errFailureExitRange,
	errorhandling.Outcome{Code: errorhandling.ExitCodeUsage, Level: slog.LevelWarn, Usage: true},
)

ErrBadFailureExit reports an --announce-failure-exit a caller could not tell apart from colophon's own failures, or the shell's.

View Source
var ErrNoRelease = errors.New("announce: no release to announce")

ErrNoRelease reports a tag carrying no release object. Announcing one that does not exist would put out a link to nothing.

View Source
var ErrTagRequired = errors.New("announce: --tag names the release to announce")

ErrTagRequired reports a run with no release named.

View Source
var ErrUnknownAdapter = errors.New("announce: no such adapter")

ErrUnknownAdapter reports an adapter the manifest names and colophon does not have.

Functions

func CheckFailureExit added in v0.17.0

func CheckFailureExit(code int) error

CheckFailureExit refuses a code that already means something else. Zero is unset.

func NewCmdAnnounce

func NewCmdAnnounce(props *props.Props) *setup.Command

func OperatorAnnounce added in v0.13.0

func OperatorAnnounce(p *props.Props) ([]manifest.Announce, error)

OperatorAnnounce reads the operator's announce block from the configuration layer: settings an adapter inherits when the manifest names it with nothing of its own (spec 0026 D2). No configuration is no block.

func Run

func Run(ctx context.Context, p *props.Props, opts *AnnounceOptions, w io.Writer) error

Run is RunAnnounce with its output injected.

func RunAnnounce

func RunAnnounce(ctx context.Context, p *props.Props, opts *AnnounceOptions, _ []string) error

RunAnnounce is the `announce` verb.

func Withheld added in v0.13.0

func Withheld(w io.Writer, tags []string) error

Withheld says a release was created and deliberately not announced.

Types

type AnnounceOptions

type AnnounceOptions struct {
	Tag                 string
	Forge               string
	Repo                string
	Remote              string
	AuthorName          string
	AuthorEmail         string
	AnnounceFailureExit int
	Only                []string
}

type Created added in v0.13.0

type Created struct {
	Root     string
	Settings manifest.Manifest
	Origin   remote.Remote
	Reader   release.Reader
	Provider forge.Provider
	Author   object.Signature

	// Adapters, when set, stands in for what the manifest configures.
	Adapters []libannounce.Configured

	// FailureExit is --announce-failure-exit; zero keeps exit 0.
	FailureExit int
}

Created announces the releases a run just created, for publish and release (spec 0026 D1). Nothing is printed when the manifest names no adapter: a project that did not opt in sees no change to its report.

func (Created) Do added in v0.13.0

func (c Created) Do(ctx context.Context, p *props.Props, w io.Writer, tags []string) error

Do announces each tag and writes the report under an `announce` heading.

Jump to

Keyboard shortcuts

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