feat: implement versioning and release management in the project
- Added automatic versioning based on git tags using semantic-release in Gitea Actions. - Introduced new API endpoints `GET /version` and `GET /v1/version` to expose build metadata. - Updated Docker build process to include version and build time information in Go binaries. - Enhanced documentation with details on release processes and versioning guidelines. - Integrated version display in the web application for better user visibility.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// Package version holds build metadata injected at link time via -ldflags.
|
||||
package version
|
||||
|
||||
// Link-time variables (defaults for local development).
|
||||
var (
|
||||
Version = "dev"
|
||||
GitSHA = "unknown"
|
||||
BuildTime = ""
|
||||
)
|
||||
|
||||
// Info returns build metadata, substituting safe defaults for empty values.
|
||||
func Info() (ver, gitSHA, buildTime string) {
|
||||
ver = Version
|
||||
if ver == "" {
|
||||
ver = "dev"
|
||||
}
|
||||
gitSHA = GitSHA
|
||||
if gitSHA == "" {
|
||||
gitSHA = "unknown"
|
||||
}
|
||||
buildTime = BuildTime
|
||||
return ver, gitSHA, buildTime
|
||||
}
|
||||
Reference in New Issue
Block a user