Compare commits

..

2 commits

Author SHA1 Message Date
7187ebbdc1 feat(metadata): move version string to version.txt
- create version.txt to store the version number
- add function to read version from version.txt
- replace hardcoded version with dynamic retrieval
2024-11-08 14:14:28 +01:00
7e7c46dc4c feat: update -version output 2024-11-07 20:58:14 +01:00
3 changed files with 4 additions and 32 deletions

View file

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

View file

@ -1,27 +0,0 @@
version: '3'
vars:
RELEASE:
sh: svu next --strip-prefix
VERSIONFILE: version.txt
COMMITMSG: "chore: bump version to v{{.RELEASE}}"
tasks:
release:tag:
cmds:
- git tag v{{.RELEASE}}
release:file:
cmds:
- echo {{.RELEASE}} >{{.VERSIONFILE}}
- git add {{.VERSIONFILE}}
- git commit -m "{{.COMMITMSG}}"
release:push:
aliases: [dorelease]
cmds:
- task: release:file
- task: release:tag
- git push
- git push --tags
- goreleaser release

View file

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