- Go 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Suite release / check-build (none, ubuntu-latest) (ubuntu-latest, none) (push) Has been skipped
Suite release / scope (push) Successful in 50s
Suite release / publish (push) Has been skipped
Suite release / deliver (push) Has been skipped
Suite release / deliver-prune (push) Has been skipped
Suite release / build (none, ubuntu-latest) (ubuntu-latest, none) (push) Has been skipped
Suite release / reused-checks (push) Has been skipped
Suite release / deploy-image (push) Has been skipped
Suite release / reserve (push) Has been skipped
Suite release / check-manifest (push) Has been skipped
Suite release / check-package (push) Has been skipped
Suite release / finalize (push) Has been skipped
Suite release / module (push) Has been skipped
|
||
| buildinfo.go | ||
| buildinfo_test.go | ||
| executable_other.go | ||
| executable_windows.go | ||
| executable_windows_test.go | ||
| go.mod | ||
| go.sum | ||
| README.md | ||
buildinfo
What a home Go program was built from. The release suite stamps the release, its repository,
the Forgejo server and the build time into this package with -ldflags -X, by the names it
stamps every Go release with
(pipeline-templates'
suites/go/build.mjs); a local build leaves them empty and says so.
VersionandTag: the release CI stamped (Tagis empty for a local build).AnswerVersion: a program run with--versionalone writes its release and returns, so every program carries the release it came from (PIPT-48).Read: the lines of a terminal app's palette "info" panel: its repo and link, version, build time in Pacific time, where it runs from (the image the process mapped, so thecurrentjunction doesn't hide the release) and its checkout underD:\repos.
It joins at-home-tools' and agent-tools' buildinfo packages, which were one copy each,
until shared packages got repositories of their own
(AGT-85,
AHT-258).
Using it
require forgejo.romaine.life/romaine-life/buildinfo v0.1.1
import "forgejo.romaine.life/romaine-life/buildinfo"
func main() {
if buildinfo.AnswerVersion(os.Args[1:], os.Stdout) {
return
}
...
}
A program's .goreleaser.yaml stamps it:
ldflags: >-
-s -w
{{ if isEnvSet "VERSION" }}-X forgejo.romaine.life/romaine-life/buildinfo.version={{ .Env.VERSION }}{{ end }}
Testing
go test ./...; the panel's Windows tests run on Windows.
Shipping
A library: the release-module topic in pipeline-templates' fleet.json tags each merge that
changes the code, and every fleet repository whose go.mod requires it gets a take-up.
Forgejo pushes it to its public GitHub copy, which proxy.golang.org serves to builds
outside CI.