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 ¶
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`.
const Tags = "v*"
Tags is the pattern of a release's tag when the project names none.
Variables ¶
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.
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.
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.
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 ¶
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
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.