From 8208af72ac45fa36c46f9ea4dfff72ef5c13ff39 Mon Sep 17 00:00:00 2001 From: Shtorm <108103062+shtorm-7@users.noreply.github.com> Date: Fri, 4 Sep 2026 09:20:40 +0300 Subject: [PATCH] build: add desktop release targets and trim go version suffix --- Makefile | 16 ++++++++++++++++ cmd/internal/update_desktop_version/main.go | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/Makefile b/Makefile index d3c4f675..97be2a14 100644 --- a/Makefile +++ b/Makefile @@ -141,6 +141,22 @@ release_android: lib_android update_android_version build_android upload_android publish_android: cd ../sing-box-for-android && ./gradlew :app:publishPlayReleaseBundle && ./gradlew --stop +build_desktop_windows: + cd ../sing-box-for-desktop && pnpm install --frozen-lockfile && pnpm run package:win + +build_desktop_linux: + cd ../sing-box-for-desktop && pnpm install --frozen-lockfile && pnpm run package:linux + +upload_desktop: + mkdir -p dist/release_desktop + cp ../sing-box-for-desktop/release/SFW-*.exe dist/release_desktop 2>/dev/null || true + cp ../sing-box-for-desktop/release/SFL-*.deb ../sing-box-for-desktop/release/SFL-*.rpm ../sing-box-for-desktop/release/SFL-*.pkg.tar.zst dist/release_desktop 2>/dev/null || true + ghr --replace --draft --prerelease -p 5 "v${VERSION}" dist/release_desktop + ./codeberg-release.sh --replace --draft --prerelease -p 5 "v${VERSION}" dist/release_desktop + rm -rf dist/release_desktop + +release_desktop: update_desktop_version build_desktop_windows build_desktop_linux upload_desktop + # TODO: find why and remove `-destination 'generic/platform=iOS'` # TODO: remove xcode clean when fix control widget fixed build_ios: diff --git a/cmd/internal/update_desktop_version/main.go b/cmd/internal/update_desktop_version/main.go index ee8375d7..7cfe8785 100644 --- a/cmd/internal/update_desktop_version/main.go +++ b/cmd/internal/update_desktop_version/main.go @@ -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) {