Compare commits
5 commits
da4a2ce7b0
...
9d92b6858a
Author | SHA1 | Date | |
---|---|---|---|
9d92b6858a | |||
12b01a2757 | |||
b910d9251b | |||
a809f4c53e | |||
6b90c5e4a2 |
5 changed files with 50 additions and 3 deletions
|
@ -23,6 +23,9 @@ upx:
|
||||||
|
|
||||||
changelog:
|
changelog:
|
||||||
use: gitea
|
use: gitea
|
||||||
|
filters:
|
||||||
|
exclude:
|
||||||
|
- "chore: bump version to"
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
- format: binary
|
- format: binary
|
||||||
|
|
33
Taskfile.yml
Normal file
33
Taskfile.yml
Normal 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
|
|
@ -28,7 +28,7 @@ func Start() {
|
||||||
|
|
||||||
// show server and protocl version and exit
|
// show server and protocl version and exit
|
||||||
if *showVersionFlag {
|
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)
|
fmt.Printf("Protocol-Version: v%s\n", metadata.ProtocolVersion)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,16 @@
|
||||||
package metadata
|
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
|
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