feat(gorleaser): set version from git tag on build

- make `GoTomatoVersion` a variable and default it to "devel"
- add ldflags to `.goreleaser.yaml` for version tagging
- remove "v" from output of `-version`
This commit is contained in:
Sebastian Mark 2024-11-07 11:38:45 +01:00
parent 783d158e92
commit 93f39507c1
3 changed files with 6 additions and 3 deletions

View file

@ -28,8 +28,8 @@ func Start() {
// show server and protocl version and exit
if *showVersionFlag {
fmt.Printf("Server-Version: v%s\n", metadata.GoTomatoVersion)
fmt.Printf("Protocol-Version: v%s\n", metadata.ProtocolVersion)
fmt.Println("Server-Version:", metadata.GoTomatoVersion)
fmt.Println("Protocol-Version:", metadata.ProtocolVersion)
os.Exit(0)
}