release

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package release builds the versioned, checksummed release artifacts (NFR-010): one ghtmx binary per supported platform, archived with the license and README, plus a sha256 checksums file. The version comes from the embedded .version file — the release workflow stamps it from the tag before building — so the binary, the module tag, and every component in the single module carry one version.

Index

Constants

This section is empty.

Variables

View Source
var Targets = []Target{
	{"linux", "amd64"},
	{"linux", "arm64"},
	{"darwin", "amd64"},
	{"darwin", "arm64"},
	{"windows", "amd64"},
	{"windows", "arm64"},
}

Targets is the supported platform matrix.

Functions

func ArchiveName added in v0.1.7

func ArchiveName(bare string, target Target) string

ArchiveName is the release asset name for one target, extension included: ghtmx_<bare>_<os>_<arch> with .zip on Windows and .tar.gz elsewhere. bare is the version without the "v" prefix. This is the single definition of the naming convention — the release build, the install-path check, and scripts/install.sh all depend on it, and a change here changes what users download.

func Build

func Build(root, version, dst string) error

Build cross-compiles cmd/ghtmx for every target, packages each into an archive named ghtmx_<version>_<os>_<arch>, and writes checksums.txt (sha256sum format) over the archives. version is the tag form ("v1.2.3"); archive names carry it without the prefix.

func BuildOne

func BuildOne(root, dst, bare string, target Target) (string, error)

BuildOne builds and archives a single target, returning the archive name. The install-path check uses it for the running platform.

func Extract

func Extract(archive, dst string) error

Extract unpacks a release archive (tar.gz or zip) into dst, restoring the binary's executable bit — the same steps an installing user performs. Entries are flattened into dst (which also makes the extraction zip-slip-safe by construction); non-regular entries are skipped. The archives this package builds are flat regular files.

Types

type Target

type Target struct {
	GOOS   string
	GOARCH string
}

Target is one platform build.

Directories

Path Synopsis
Command cmd builds the release artifacts (used by the release workflow; tests exercise the same builder on every CI run).
Command cmd builds the release artifacts (used by the release workflow; tests exercise the same builder on every CI run).

Jump to

Keyboard shortcuts

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