Compare commits

...

2 commits

Author SHA1 Message Date
3a5deffd2d chore(goreleaser): remove unused filter from changelog
- remove the filter that excludes version bump entries from changelog

🤖
2024-11-07 19:20:33 +01:00
61fc21224c feat: 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`
2024-11-07 19:20:29 +01:00
3 changed files with 6 additions and 6 deletions

View file

@ -15,6 +15,8 @@ builds:
- arm64
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X git.smsvc.net/pomodoro/GoTomato/internal/metadata.GoTomatoVersion={{.Version}}
upx:
- enabled: true
@ -23,9 +25,6 @@ upx:
changelog:
sort: desc
filters:
exclude:
- "bump version to"
archives:
- format: binary

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)
}

View file

@ -2,5 +2,6 @@ package metadata
import "strings"
const GoTomatoVersion = "0.1.1" // The GoTomato version
// This will be overwritten by goreleaser on build
var GoTomatoVersion = "devel" // The GoTomato version
var ProtocolVersion = strings.Split(GoTomatoVersion, ".")[0] // The protocol version