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) ([]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 NewCmdRelease ¶
NewCmdRelease builds the `release` command.
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 ¶
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 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 ¶
Prepared is everything `release` resolved before touching a forge.
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.