Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into pre-release
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/github_build_release_windows.yml
  • Loading branch information
JyCyun committed May 29, 2021
2 parents c8bc537 + 7252321 commit c150a74
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/github_build_dev_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Build Dev Windows
on:
push:
branches:
- canary
- develop
pull_request:
branches:
- canary
- develop

env:
go-version: '^1.16.4'
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/github_build_release_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
}
}
Expand All @@ -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
Expand Down
11 changes: 9 additions & 2 deletions controller/profile_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion systray/systray.go
Original file line number Diff line number Diff line change
Expand Up @@ -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数据库", "")
Expand Down

0 comments on commit c150a74

Please sign in to comment.