release

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 11 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 BlockStart, BlockEnd = "x-release-please-start-", "x-release-please-end"

BlockStart and BlockEnd are release-please's markers around lines it bumps, each line in between: `x-release-please-start-version` (or -major, -minor, -patch), then `x-release-please-end`.

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.

View Source
var Manifests = []string{".release-please-manifest.json"}

Manifests are the files a tool keeps its versions in, every line a version it bumps: release-please's.

View Source
var Markers = []struct {
	Text  string
	Bumps *regexp.Regexp
}{
	{"x-release-please-version", semver}, {"x-releaser-pleaser-version", semver},
	{"x-release-please-major", number}, {"x-release-please-minor", number}, {"x-release-please-patch", number},
}

Markers are what the known tools' generic updaters look for on a line whose version they bump, and what they bump there: a version, or one part of it.

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.

func OnlyBumps added in v0.29.0

func OnlyBumps(path, diff string, now func() (string, error)) bool

OnlyBumps says whether a file's change, its `git diff -U0`, only bumps versions as a release tool does: each hunk puts back as many lines as it takes, each the same line but for its first version (or first number, for a major, minor or patch marker), on a line the tool marks — its marker on the line, the line between a block's markers in the file now, or a line of its manifest. now reads the file at the diff's end, only when a block is to be looked for. A file added, removed, moved or changed in its mode is no bump.

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