Documentation
¶
Overview ¶
Package release implements the `release` verb: create the release object for a tag that already exists.
Index ¶
- Variables
- func DraftPublisherFrom(provider forge.Provider) release.DraftPublisher
- func NewCmdRelease(props *props.Props) *setup.Command
- func ReleasePublishersFrom(provider forge.Provider) (release.Publisher, release.AssetPublisher)
- func ResolveAssets(ctx context.Context, dist, base string, named []string, ...) ([]forge.ReleaseAssetSource, error)
- func Run(ctx context.Context, p *props.Props, opts *ReleaseOptions, w io.Writer) error
- func RunRelease(ctx context.Context, p *props.Props, opts *ReleaseOptions, _ []string) error
- type Options
- type Prepared
- type ReleaseOptions
Constants ¶
This section is empty.
Variables ¶
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 ReleasePublishersFrom ¶
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, named []string, verify ...artifacts.VerifyOption, ) ([]forge.ReleaseAssetSource, error)
ResolveAssets works out what a release should carry and proves each item is where it will be published as living, under base.
The names come from one of two places (spec 0017 D2): goreleaser's manifest under dist, or `assets` in the project's manifest for a project no build tool describes. Naming both is refused rather than merged — a union would leave somebody wondering which source a missing asset should have come from.
Only `release` attaches assets; `publish` lost its asset flags when spec 0005 D7 completed (colophon#36).
The resolve check is here and not in the forge because go/forge records a location without fetching it, deliberately: its guarantee is that no observer sees a release before its assets are attached, not that the assets are real.
Nothing named at all means no assets and is not an error. A source without a base is, because it would silently publish a release with no assets.
func RunRelease ¶
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
// Assets are the files the manifest names, for a project whose artefacts
// no build tool describes (spec 0017). Empty means goreleaser's manifest
// is consulted instead.
Assets []string
// Root and Settings are what the announcement after the release needs
// (spec 0026 D1).
Root string
Settings manifest.Manifest
}
Prepared is everything `release` resolved before touching a forge.