Compare commits

...

5 commits

Author SHA1 Message Date
da4a2ce7b0 limit git tasks to main branch 2024-11-08 17:30:28 +01:00
1ec32bc0d9 feat: add release management via taskdev
- create `Taskfile.yml`
- update version file with the new release version
- add new version tag
- push to remote and run goreleaser
2024-11-08 17:30:28 +01:00
34026b1bc9 fix: restore filter that excludes version bump entries 2024-11-08 17:30:28 +01:00
081e1ade47 feat: update -version output 2024-11-08 17:30:28 +01:00
e9d8d2e2dd feat: 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 17:30:25 +01:00
5 changed files with 50 additions and 3 deletions

View file

@ -23,6 +23,9 @@ upx:
changelog:
use: gitea
filters:
exclude:
- "chore: bump version to"
archives:
- format: binary

33
Taskfile.yml Normal file
View file

@ -0,0 +1,33 @@
version: '3'
vars:
RELEASE:
sh: svu next --strip-prefix
VERSIONFILE: version.txt
COMMITMSG: "chore: bump version to v{{.RELEASE}}"
CURRENTBRANCH:
sh: git branch --show-current
tasks:
release:tag:
preconditions:
- test {{.CURRENTBRANCH}} == "main"
cmds:
- git tag v{{.RELEASE}}
release:file:
preconditions:
- test {{.CURRENTBRANCH}} == "main"
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,7 +28,7 @@ func Start() {
// show server and protocl version and exit
if *showVersionFlag {
fmt.Printf("Server-Version: v%s\n", metadata.GoTomatoVersion)
fmt.Printf("GoTomato v%s\n", metadata.GoTomatoVersion)
fmt.Printf("Protocol-Version: v%s\n", metadata.ProtocolVersion)
os.Exit(0)
}

View file

@ -1,6 +1,16 @@
package metadata
import "strings"
import (
"os"
"strings"
)
const GoTomatoVersion = "0.1.1" // The GoTomato version
func getVersion() string {
content, _ := os.ReadFile("version.txt")
version := strings.TrimSpace(string(content))
return version
}
var GoTomatoVersion = getVersion() // The GoTomato version
var ProtocolVersion = strings.Split(GoTomatoVersion, ".")[0] // The protocol version

1
version.txt Normal file
View file

@ -0,0 +1 @@
devel