diff --git a/.github/workflows/github_build_dev_windows.yml b/.github/workflows/github_build_dev_windows.yml index 6af4a0b..9e3a1c7 100644 --- a/.github/workflows/github_build_dev_windows.yml +++ b/.github/workflows/github_build_dev_windows.yml @@ -2,10 +2,10 @@ name: Build Dev Windows on: push: branches: - - canary + - develop pull_request: branches: - - canary + - develop env: go-version: '^1.16.4' diff --git a/.github/workflows/github_build_release_windows.yml b/.github/workflows/github_build_release_windows.yml index 391af00..404543e 100644 --- a/.github/workflows/github_build_release_windows.yml +++ b/.github/workflows/github_build_release_windows.yml @@ -73,28 +73,30 @@ jobs: echo "Build Version: v${env:BUILD_VERSION}`nCurrent Tag: ${env:GIT_TAG}`nLatest Tag: ${env:GIT_TAG_LATEST}`n" if (!(${env:GIT_TAG} -match ${env:VERSION_REGEXP}) -or ${env:GIT_TAG} -eq '') { $NOT_PASSED=1 - echo "Cannot get the version information." + echo "Cannot get the version information or it's incorrect." } if ($NOT_PASSED -eq 0) { $INTERNAL_VERSION_REGEXP='^(\d+\.\d+\.\d+)(\.\d+)?$' $fileVersion=cat .\versioninfo.json | jq -r '.FixedFileInfo.FileVersion' $fileVersion=(echo $fileVersion | jq -r '.Major, .Minor, .Patch, .Build') -join '.' - $fileVersion=[regex]::Match($fileVersion, $INTERNAL_VERSION_REGEXP) - if (!$fileVersion.success) { - $NOT_PASSED=-1 + $tmpVer=[regex]::Match($fileVersion, $INTERNAL_VERSION_REGEXP) + if (!$tmpVer.success) { + $NOT_PASSED=1 } else { - $fileVersion=$fileVersion.Groups[1].Value + $fileVersion=$tmpVer.Groups[1].Value + if ($tmpVer.Groups[2].Value -ne '.0') { $fileVersion+=$tmpVer.Groups[2].Value} } if ($NOT_PASSED -eq 0) { $productVersion=cat .\versioninfo.json | jq -r '.FixedFileInfo.ProductVersion' $productVersion=(echo $productVersion | jq -r '.Major, .Minor, .Patch, .Build') -join '.' - $productVersion=[regex]::Match($productVersion, $INTERNAL_VERSION_REGEXP) - if (!$productVersion.success) { - $NOT_PASSED=-1 + $tmpVer=[regex]::Match($productVersion, $INTERNAL_VERSION_REGEXP) + if (!$tmpVer.success) { + $NOT_PASSED=1 } else { - $productVersion=$productVersion.Groups[1].Value + $productVersion=$tmpVer.Groups[1].Value + if ($tmpVer.Groups[2].Value -ne '.0') { $productVersion+=$tmpVer.Groups[2].Value} } } } @@ -109,7 +111,7 @@ jobs: $NOT_PASSED=1 echo "A newer or the current version already exists." } - if ($NOT_PASSED -ge 0) { + if ($NOT_PASSED -ne 0) { echo "Check the version information is not passed." echo "This build has been aborted." exit 1 diff --git a/controller/profile_info.go b/controller/profile_info.go index 43ff32e..4990f8b 100644 --- a/controller/profile_info.go +++ b/controller/profile_info.go @@ -217,14 +217,21 @@ func updateConfig(Name, url string) bool { if err != nil { return false } - if resp != nil { + if resp != nil && resp.StatusCode == 200 { + body, _ := ioutil.ReadAll(resp.Body) + Reg, _ := regexp.MatchString(`port`, string(body)) + if Reg != true { + fmt.Println("错误的内容") + return false + } + rebody := ioutil.NopCloser(bytes.NewReader(body)) f, errf := os.OpenFile(fmt.Sprintf("./Profile/%s.yaml", Name), os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0766) if errf != nil { panic(err) return false } f.WriteString(fmt.Sprintf("# Clash.Mini : %s\n", url)) - io.Copy(f, resp.Body) + io.Copy(f, rebody) resp.Body.Close() f.Close() return true diff --git a/systray/systray.go b/systray/systray.go index 66c25a3..b1fcce3 100644 --- a/systray/systray.go +++ b/systray/systray.go @@ -52,7 +52,7 @@ func onReady() { mConfig := systray.AddMenuItem("配置管理", "") mOther := systray.AddMenuItem("其他设置", "") mOtherTask := mOther.AddSubMenuItem("设置开机启动", "") - mOtherAutosys := mOther.AddSubMenuItem("设置系统代理", "") + mOtherAutosys := mOther.AddSubMenuItem("设置默认代理", "") mOtherMMBD := mOther.AddSubMenuItem("设置GeoIP2数据库", "") MaxMindMMBD := mOtherMMBD.AddSubMenuItem("MaxMind数据库", "") Hackl0usMMBD := mOtherMMBD.AddSubMenuItem("Hackl0us数据库", "")