release

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package release implements the `release` verb: create the release object for a tag that already exists.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTagRequired reports a run with no --tag. There is no default: the
	// tag is the whole input, and guessing one would release the wrong thing.
	ErrTagRequired = errors.New("release: --tag is required")

	// ErrAssetsMisconfigured reports --assets without --asset-base or the
	// reverse. Half-honouring it would publish a release with no assets, which
	// is the outcome the pair exists to prevent.
	ErrAssetsMisconfigured = errors.New("release: assets are misconfigured")

	// ErrUnknownForge reports a remote colophon cannot map to a provider.
	ErrUnknownForge = errors.New("release: unknown forge")
)

Functions

func DraftPublisherFrom added in v0.9.0

func DraftPublisherFrom(provider forge.Provider) release.DraftPublisher

DraftPublisherFrom discovers the capability that finishes a release left unpublished. Nil where the forge models no draft — GitLab and Bitbucket — and the step is then skipped entirely (spec 0014 D5). Shared with `publish`.

func NewCmdRelease

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

NewCmdRelease builds the `release` command.

func ReleasePublishersFrom

func ReleasePublishersFrom(provider forge.Provider) (release.Publisher, release.AssetPublisher)

ReleasePublishersFrom discovers the release capabilities a provider offers. Either may be nil: no release object at all, or releases without the guarantee of publishing one complete. Shared with `publish`.

func ResolveAssets

func ResolveAssets(ctx context.Context, dist, base string) ([]forge.ReleaseAssetSource, error)

ResolveAssets reads goreleaser's manifest under dist and proves each artefact is where it will be published as living, under base.

Shared by `release` and, while spec 0005 D7's transition lasts, `publish`. The check is here and not in the forge because go/forge records a location without resolving it, deliberately: its guarantee is that no observer sees a release before its assets are attached, not that the assets are real.

Both empty means no assets and is not an error. One without the other is, because it would silently publish a release with no assets.

func Run

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

Run is RunRelease with its output injected.

func RunRelease

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

RunRelease is the `release` verb.

Types

type Options

type Options struct {
	Repo   string
	Target string
	Remote string
	Tag    string

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

	// Dist is goreleaser's output directory; AssetBase is where its artefacts
	// were uploaded. Both or neither.
	Dist      string
	AssetBase string
}

Options are the command's inputs.

type Prepared

type Prepared struct {
	Request release.Request
	Forge   remote.Remote
}

Prepared is everything `release` resolved before touching a forge.

func Build

func Build(opts Options) (Prepared, error)

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

No hold is read. A hold stops `publish` deciding to release; by the time a tag exists the decision has been made, by publish or by a person. The manifest is read for `forge` alone (spec 0009 D4).

type ReleaseOptions

type ReleaseOptions struct {
	Repo   string
	Target string
	Remote string
	Forge  string

	// Tag is the existing tag to release.
	Tag string

	// Dist is goreleaser's output directory, read for its manifest.
	Dist string

	// AssetBase is the URL the artefacts were uploaded under.
	AssetBase string
}

ReleaseOptions holds the command's flags.

Jump to

Keyboard shortcuts

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