Add runtime version reporting

This commit is contained in:
2026-10-05 16:49:54 +00:00
parent 9e855c81a6
commit d692607e2b
11 changed files with 292 additions and 9 deletions

24
docs/runtime.md Normal file
View File

@@ -0,0 +1,24 @@
# Runtime version
Applications can read their embedded version through the public `buildinfo`
package:
```go
import "gitea.maximumdirect.net/eric/ReleaseKit/buildinfo"
version := buildinfo.Version()
```
`Version` returns the identifier injected into the executable when present.
Otherwise it returns the executable's main module version when that metadata is
available and is not `(devel)`. It returns `dev` when neither source provides a
release identifier. Applications should use this accessor for version output;
the runtime implementation and ReleaseKit's builder own the injection detail.
ReleaseKit's current command prints its own runtime version:
```sh
go run ./cmd/releasekit version
```
The output has the form `releasekit <version>`.