Compare commits
5 commits
6a3919e95e
...
12b01a2757
Author | SHA1 | Date | |
---|---|---|---|
12b01a2757 | |||
b910d9251b | |||
a809f4c53e | |||
6b90c5e4a2 | |||
6e19e43aa7 |
5 changed files with 45 additions and 7 deletions
|
@ -15,8 +15,6 @@ builds:
|
|||
- arm64
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
ldflags:
|
||||
- -s -w -X git.smsvc.net/pomodoro/GoTomato/internal/metadata.GoTomatoVersion={{.Version}}
|
||||
|
||||
upx:
|
||||
- enabled: true
|
||||
|
@ -25,6 +23,9 @@ upx:
|
|||
|
||||
changelog:
|
||||
use: gitea
|
||||
filters:
|
||||
exclude:
|
||||
- "chore: bump version to"
|
||||
|
||||
archives:
|
||||
- format: binary
|
||||
|
|
27
Taskfile.yml
Normal file
27
Taskfile.yml
Normal file
|
@ -0,0 +1,27 @@
|
|||
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
|
|
@ -28,8 +28,8 @@ func Start() {
|
|||
|
||||
// show server and protocl version and exit
|
||||
if *showVersionFlag {
|
||||
fmt.Println("Server-Version:", metadata.GoTomatoVersion)
|
||||
fmt.Println("Protocol-Version:", metadata.ProtocolVersion)
|
||||
fmt.Printf("GoTomato v%s\n", metadata.GoTomatoVersion)
|
||||
fmt.Printf("Protocol-Version: v%s\n", metadata.ProtocolVersion)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
package metadata
|
||||
|
||||
import "strings"
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// This will be overwritten by goreleaser on build
|
||||
var GoTomatoVersion = "devel" // 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
1
version.txt
Normal file
|
@ -0,0 +1 @@
|
|||
devel
|
Loading…
Reference in a new issue