Centralize Go validation and build environments

This commit is contained in:
2026-10-06 16:38:15 +00:00
parent 12e866a94a
commit 08093124af
15 changed files with 637 additions and 129 deletions

View File

@@ -50,13 +50,18 @@ resolved from the repository. Selected artifact filenames are regenerated. Other
directory are left in place. A failed later build or native version check returns the binaries already
generated in `BuildResult.Artifacts`.
Builds use the prepared local Go toolchain, readonly module mode, disabled
module network access, `CGO_ENABLED=0`, `-trimpath`, and `-buildvcs=false`. Each
selected target is compiled explicitly. ReleaseKit then runs the `version`
command on a native binary and requires `<binary> <version>` followed by a
newline. If no selected target matches the Go host, it builds a temporary
native binary for this check and removes it afterward. Cross-compilation does
not promise that a binary runs on another platform.
Builds use the available compatible Go toolchain selected locally; ReleaseKit
does not download a different toolchain automatically. It disables workspace
discovery and module network access, uses readonly module mode, sets
`CGO_ENABLED=0`, and passes `-trimpath` and `-buildvcs=false`. Effective cache,
module-cache, temporary-directory, and tool settings are retained, including
values from Go's persistent environment file. Ambient experiment and CPU
feature settings are cleared so the selected toolchain uses its baseline for
each target. Each selected target is compiled explicitly. ReleaseKit then runs
the `version` command on a native binary and requires `<binary> <version>`
followed by a newline. If no selected target matches the Go host, it builds a
temporary native binary for this check and removes it afterward.
Cross-compilation does not promise that a binary runs on another platform.
An empty target list records the source commit and returns without invoking Go,
creating the output directory, or running a version check. It does not require a

View File

@@ -25,8 +25,14 @@ product name and exact version as complete title elements. No local tag with
that version may already exist.
The callback receives the captured repository, commit, and version. ReleaseKit
calls it once. When omitted, ReleaseKit runs the offline Go test command. The
check revalidates the branch, commit, and cleanliness after validation.
calls it once. When omitted, ReleaseKit runs
`go test -mod=readonly -count=1 ./...` with the available compatible local Go
toolchain; it does not download a different toolchain automatically. The suite
uses the Go host target, disables workspace and module network access, and
ignores ambient `GOFLAGS`, experiment, and CPU feature overrides. Effective
cache and native cgo/C-tool settings are preserved, including values from Go's
persistent environment file. The check revalidates the branch, commit, and
cleanliness after validation.
A successful check is evidence about the local candidate only. It does not
check whether a remote branch or tag is available and does not create a tag.