release

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package release tracks which version of jaira last prepared a board, and carries the change notes a user reads when a newer binary catches up an older one.

The notes are never copied to disk anywhere: a copy can drift from the binary that reads it, but the binary always knows what is in itself. So the notes are embedded with go:embed and read straight out of the executable.

They come from two places. NOTES.md holds every release up to 0.3.6 as fixed history. Every change since is a file of its own under notes/, named after its ticket, so two branches never edit the same lines. A file directly in notes/ is Unreleased; releasing moves every one of them into notes/<version>/ (see Cut), and the folder's name is the release.

Index

Constants

This section is empty.

Variables

View Source
var Current = "dev"

Current is the version of the running binary. It is a package-level var, set once by cli.Execute, because the TUI also creates boards and plumbing a version string through the whole TUI to stamp one file is not worth it.

Functions

func Cut added in v0.3.7

func Cut(pkgDir, version string) (string, error)

Cut releases every note file directly in <pkgDir>/notes by moving it into <pkgDir>/notes/<version>/, and returns the version it used. A leading "v" is dropped, so "v0.3.7" and "0.3.7" cut the same release. It refuses a version that is not X.Y.Z, a release that already has a folder, and a release with no notes: that one would be a pull request without a commit.

The release workflow (.github/workflows/release-notes.yaml) runs it on a branch of its own; nothing here touches git.

func Important added in v0.5.7

func Important(change string) (string, bool)

Important splits the marker off a change: a line written "- ! text" is read by changeLines as the plain change "! text", and Important returns text. The marker is "! " with the space; "!text" is not one.

func MarkNotesSeen added in v0.5.7

func MarkNotesSeen(dir string) error

MarkNotesSeen records Current as the version whose release notes were read.

func Newer added in v0.5.7

func Newer(a, b string) bool

Newer reports whether version a is newer than b, comparing X.Y.Z numbers one by one.

func NotesSeen added in v0.5.7

func NotesSeen(dir string) string

NotesSeen reads <dir>/notes-seen: the last version whose release notes the user closed in the TUI, "" when none. It sits next to the stamp, per working tree and never in git: "I read them" is one person's fact, not the team's.

func Stamp

func Stamp(dir string) error

Stamp records Current as the version that last prepared dir.

func Stamped

func Stamped(dir string) string

Stamped reads <dir>/version, trimmed. Errors are deliberately swallowed: a missing or unreadable stamp is indistinguishable from "never recorded" for every purpose this serves.

Types

type Entry

type Entry struct {
	Version string
	Changes []string
}

Entry is one release's worth of change notes.

func Notes

func Notes() []Entry

Notes returns the embedded release notes, newest release first: the note files directly in notes/ as Unreleased, then one release per notes/<version>/ folder, then the fixed history in NOTES.md.

func Since

func Since(stamped string) []Entry

Since returns the entries newer than stamped, selecting by position in the notes file rather than by parsing version numbers. A stamp that appears nowhere in the file — empty, "dev", a snapshot build, or a version older than the oldest entry — cannot be reasoned about any other way, so it selects everything. Showing too much on an unknown stamp is the safe direction; showing too little is not.

Directories

Path Synopsis
Command cut releases the notes: it moves every file directly in core/release/notes into core/release/notes/<version>/ and prints the version.
Command cut releases the notes: it moves every file directly in core/release/notes into core/release/notes/<version>/ and prints the version.

Jump to

Keyboard shortcuts

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