publish

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: 25 Imported by: 0

Documentation

Overview

Package publish implements the `publish` verb: tag what landed and create its release.

Index

Constants

This section is empty.

Variables

View Source
var ErrAssetsMisconfigured = cmdrelease.ErrAssetsMisconfigured

ErrAssetsMisconfigured reports --assets without --asset-base or the reverse. The check lives with `release` now (spec 0005 D7); this name is kept for the transition.

Functions

func NewCmdPublish

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

func Run

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

Run is RunPublish with its output injected.

func RunPublish

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

RunPublish is the `publish` verb.

Types

type Options

type Options struct {
	Repo   string
	Target string
	Branch string
	Remote string
	Author tree.Author

	// Forge names the forge when the remote's host does not (spec 0009 D8).
	Forge string

	// TagOnly stops after the tag, leaving the release to a later run.
	TagOnly bool
}

Options are the command's inputs.

type Prepared

type Prepared struct {
	Request publish.Request

	// Held reports a hold in the manifest. A hold stops publish ACTING; it
	// does not stop the release being computed or its merge request being
	// maintained.
	Held       bool
	HoldReason string

	// TagAlso is what the CHECKOUT's manifest names. The commit being
	// published may name fewer; the report says so rather than tagging.
	TagAlso []string

	// LatestTag is the newest release tag reachable from the checkout, before
	// this run cuts anything. Checked for a release object at the end of the
	// run, because a release that half-happened leaves exactly this: a tag
	// nothing published (spec 0018 D1).
	LatestTag string

	Forge remoteForge

	// Root and Settings are what the announcement after the release needs,
	// kept so it is not loaded twice (spec 0026 D1).
	Root     string
	Settings manifest.Manifest
}

Prepared is everything `publish` resolved before writing anything.

func Build

func Build(opts Options) (Prepared, error)

Build assembles the request from a repository, without touching a forge.

type PublishOptions

type PublishOptions struct {
	Repo                string
	Target              string
	Branch              string
	Remote              string
	Forge               string
	AuthorName          string
	AuthorEmail         string
	TagOnly             bool
	NoAnnounce          bool
	AnnounceFailureExit int
}

Jump to

Keyboard shortcuts

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