Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
xishang0128 committed Feb 23, 2024
1 parent 0e1b646 commit 415e48e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ jobs:
tar -czvf mihomo-${GOOS}-${{matrix.jobs.output}}-${VERSION}.tar.gz mihomo
fi
- name: Save version
run: echo ${VERSION} > bin/version.txt
shell: bash

- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
18 changes: 9 additions & 9 deletions hub/updater/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
// modify from https://github.com/AdguardTeam/AdGuardHome/blob/595484e0b3fb4c457f9bb727a6b94faa78a66c5f/internal/updater/updater.go
// Updater is the mihomo updater.
var (
goarm string
gomips string
amd64Compatible string
goarm string
gomips string
amd64 string

workDir string

Expand All @@ -42,15 +42,15 @@ var (
backupExeName string // 备份文件名
updateExeName string // 更新后的可执行文件

baseURL string = "https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/mihomo"
versionURL string = "https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/version.txt"
baseURL string = "https://github.com/xishang0128/mihomo/releases/download/Prerelease-Alpha/mihomo"
versionURL string = "https://github.com/xishang0128/mihomo/releases/download/Prerelease-Alpha/version.txt"
packageURL string
latestVersion string
)

func init() {
if runtime.GOARCH == "amd64" && cpuid.CPU.X64Level() < 3 {
amd64Compatible = "-compatible"
if runtime.GOARCH == "amd64" && cpuid.CPU.X64Level() > 2 {
amd64 = "_v3"
}
}

Expand Down Expand Up @@ -136,9 +136,9 @@ func prepare(exePath string) (err error) {
backupDir = filepath.Join(workDir, "meta-backup")

if runtime.GOOS == "windows" {
updateExeName = "mihomo" + "-" + runtime.GOOS + "-" + runtime.GOARCH + amd64Compatible + ".exe"
updateExeName = "mihomo" + "-" + runtime.GOOS + "-" + runtime.GOARCH + amd64 + ".exe"
} else {
updateExeName = "mihomo" + "-" + runtime.GOOS + "-" + runtime.GOARCH + amd64Compatible
updateExeName = "mihomo" + "-" + runtime.GOOS + "-" + runtime.GOARCH + amd64
}

log.Infoln("updateExeName: %s ", updateExeName)
Expand Down

0 comments on commit 415e48e

Please sign in to comment.