diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d758988e0..36c736132 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -821,7 +821,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 26 + node-version-file: clients/desktop/package.json cache: pnpm cache-dependency-path: | clients/desktop/pnpm-lock.yaml diff --git a/cmd/internal/update_desktop_version/main.go b/cmd/internal/update_desktop_version/main.go index b99ead6a7..ee8375d79 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" + "runtime" "github.com/sagernet/sing-box/cmd/internal/build_shared" "github.com/sagernet/sing-box/log" @@ -17,7 +18,8 @@ var ( ) type versionMetadata struct { - Version string `json:"version"` + Version string `json:"version"` + GoVersion string `json:"go_version"` } func init() { @@ -38,15 +40,24 @@ func main() { var metadata versionMetadata common.Must(json.NewDecoder(versionFile).Decode(&metadata)) common.Must(versionFile.Close()) - if metadata.Version == newVersion { + newGoVersion := runtime.Version() + versionUpdated := metadata.Version != newVersion + goVersionUpdated := metadata.GoVersion != newGoVersion + if !(versionUpdated || goVersionUpdated) { log.Info("version not changed") return } - log.Info("updated version from ", metadata.Version, " to ", newVersion) + if versionUpdated { + log.Info("updated version from ", metadata.Version, " to ", newVersion) + } + if goVersionUpdated { + log.Info("updated Go version from ", metadata.GoVersion, " to ", newGoVersion) + } if flagRunInCI && !flagRunNightly { log.Fatal("version changed, commit changes first.") } metadata.Version = newVersion + metadata.GoVersion = newGoVersion outputFile := common.Must1(os.Create(versionPath)) encoder := json.NewEncoder(outputFile) encoder.SetIndent("", " ")