build: add desktop release targets and trim go version suffix

This commit is contained in:
Shtorm
2026-09-04 09:20:40 +03:00
parent bcb83578d9
commit 8208af72ac
2 changed files with 20 additions and 0 deletions
@@ -5,6 +5,7 @@ import (
"flag"
"os"
"path/filepath"
"regexp"
"runtime"
"github.com/sagernet/sing-box/cmd/internal/build_shared"
@@ -41,6 +42,9 @@ func main() {
common.Must(json.NewDecoder(versionFile).Decode(&metadata))
common.Must(versionFile.Close())
newGoVersion := runtime.Version()
if match := regexp.MustCompile(`^go\d+\.\d+(?:\.\d+)?`).FindString(newGoVersion); match != "" {
newGoVersion = match
}
versionUpdated := metadata.Version != newVersion
goVersionUpdated := metadata.GoVersion != newGoVersion
if !(versionUpdated || goVersionUpdated) {