release

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package release says what a project's releases are, for the roles that hold them (ADR-0017): the branches a release tool opens its pull request from, and the last release, one lookup for every reader.

Index

Constants

View Source
const Tags = "v*"

Tags is the pattern of a release's tag when the project names none.

Variables

View Source
var Branches = []string{"release-please--*", "releaser-pleaser--*", "release-plz-*", "changeset-release/*"}

Branches are the head branches of the release pull requests the known tools open: release-please, releaser-pleaser, release-plz, changesets.

View Source
var ErrShallow = errors.New("this clone is shallow: the last release may be in the history it lacks; fetch it whole (actions/checkout's `fetch-depth: 0`, GitLab's `GIT_DEPTH: 0`)")

ErrShallow is a clone missing history: the last release may be in what was not fetched, and starting from no tag would take every doc ever suspect for the release's.

Functions

func Last

func Last(repo, pattern string) (string, error)

Last is the last release HEAD holds: the highest version among the tags matching the pattern and merged into HEAD — not the nearest, which a hotfix merged back would be. A prerelease (v1.2.0-rc.1) and an alias (v1, latest) are not releases. "" when there is none.

Types

type Settings

type Settings struct {
	Branches []string `yaml:"branches"` // replace the tools' when set
	Tags     string   `yaml:"tags"`
}

Settings are the project's `release` key in .workline/config.yaml.

func Load

func Load(repo string) (Settings, error)

Load reads the project's release settings, the defaults where it says nothing. The config was checked by whoever loaded it first.

func (Settings) IsBranch

func (s Settings) IsBranch(branch string) bool

IsBranch says whether a merge request from this branch is a release tool's: the release, held as one.

Jump to

Keyboard shortcuts

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