Skip to content

Commit 32ae6f8

Browse files
committed
patch: self mod
1 parent 40587b6 commit 32ae6f8

5 files changed

Lines changed: 22 additions & 104 deletions

File tree

.github/workflows/build.yml

Lines changed: 14 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
env:
25-
REGISTRY: docker.io
25+
REGISTRY: ghcr.io
2626
jobs:
2727
build:
2828
runs-on: ubuntu-latest
@@ -36,22 +36,21 @@ jobs:
3636
- { goos: linux, goarch: '386', go386: sse2, output: '386', debian: i386, rpm: i386}
3737
- { goos: linux, goarch: '386', go386: softfloat, output: '386-softfloat' }
3838
- { goos: linux, goarch: amd64, goamd64: v1, output: amd64-compatible, test: test }
39-
- { goos: linux, goarch: amd64, goamd64: v3, output: amd64, debian: amd64, rpm: x86_64, pacman: x86_64}
40-
- { goos: linux, goarch: arm64, output: arm64, debian: arm64, rpm: aarch64, pacman: aarch64}
39+
- { goos: linux, goarch: amd64, goamd64: v3, output: amd64 }
40+
- { goos: linux, goarch: arm64, output: arm64 }
4141
- { goos: linux, goarch: arm, goarm: '5', output: armv5 }
42-
- { goos: linux, goarch: arm, goarm: '6', output: armv6, debian: armel, rpm: armv6hl}
43-
- { goos: linux, goarch: arm, goarm: '7', output: armv7, debian: armhf, rpm: armv7hl, pacman: armv7hl}
42+
- { goos: linux, goarch: arm, goarm: '6', output: armv6 }
43+
- { goos: linux, goarch: arm, goarm: '7', output: armv7 }
4444
- { goos: linux, goarch: mips, gomips: hardfloat, output: mips-hardfloat }
4545
- { goos: linux, goarch: mips, gomips: softfloat, output: mips-softfloat }
4646
- { goos: linux, goarch: mipsle, gomips: hardfloat, output: mipsle-hardfloat }
4747
- { goos: linux, goarch: mipsle, gomips: softfloat, output: mipsle-softfloat }
4848
- { goos: linux, goarch: mips64, output: mips64 }
49-
- { goos: linux, goarch: mips64le, output: mips64le, debian: mips64el, rpm: mips64el }
50-
- { goos: linux, goarch: loong64, output: loong64-abi1, abi: '1', debian: loongarch64, rpm: loongarch64 }
51-
- { goos: linux, goarch: loong64, output: loong64-abi2, abi: '2', debian: loong64, rpm: loong64 }
52-
- { goos: linux, goarch: riscv64, output: riscv64, debian: riscv64, rpm: riscv64 }
53-
- { goos: linux, goarch: s390x, output: s390x, debian: s390x, rpm: s390x }
54-
- { goos: linux, goarch: ppc64le, output: ppc64le, debian: ppc64el, rpm: ppc64le }
49+
- { goos: linux, goarch: mips64le, output: mips64le }
50+
- { goos: linux, goarch: loong64, output: loong64-abi1, abi: '1' }
51+
- { goos: linux, goarch: loong64, output: loong64-abi2, abi: '2' }
52+
- { goos: linux, goarch: riscv64, output: riscv64 }
53+
- { goos: linux, goarch: s390x, output: s390x }
5554

5655
- { goos: windows, goarch: '386', output: '386' }
5756
- { goos: windows, goarch: amd64, goamd64: v1, output: amd64-compatible }
@@ -68,12 +67,6 @@ jobs:
6867
- { goos: android, goarch: arm, ndk: armv7a-linux-androideabi34, output: armv7 }
6968
- { goos: android, goarch: arm64, ndk: aarch64-linux-android34, output: arm64-v8 }
7069

71-
# Go 1.23 with special patch can work on Windows 7
72-
# https://github.com/MetaCubeX/go/commits/release-branch.go1.23/
73-
- { goos: windows, goarch: '386', output: '386-go123', goversion: '1.23' }
74-
- { goos: windows, goarch: amd64, goamd64: v1, output: amd64-compatible-go123, goversion: '1.23' }
75-
- { goos: windows, goarch: amd64, goamd64: v3, output: amd64-go123, goversion: '1.23' }
76-
7770
# Go 1.22 with special patch can work on Windows 7
7871
# https://github.com/MetaCubeX/go/commits/release-branch.go1.22/
7972
- { goos: windows, goarch: '386', output: '386-go122', goversion: '1.22' }
@@ -102,11 +95,6 @@ jobs:
10295
- { goos: darwin, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, goversion: '1.20' }
10396
- { goos: darwin, goarch: amd64, goamd64: v3, output: amd64-go120, goversion: '1.20' }
10497

105-
# Go 1.23 is the last release that requires Linux kernel version 2.6.32 or later. Go 1.24 will require Linux kernel version 3.2 or later.
106-
- { goos: linux, goarch: '386', output: '386-go123', goversion: '1.23' }
107-
- { goos: linux, goarch: amd64, goamd64: v1, output: amd64-compatible-go123, goversion: '1.23', test: test }
108-
- { goos: linux, goarch: amd64, goamd64: v3, output: amd64-go123, goversion: '1.23' }
109-
11098
# only for test
11199
- { goos: linux, goarch: '386', output: '386-go120', goversion: '1.20' }
112100
- { goos: linux, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, goversion: '1.20', test: test }
@@ -258,45 +246,7 @@ jobs:
258246
rm mihomo-${{matrix.jobs.goos}}-${{matrix.jobs.output}}
259247
fi
260248
261-
- name: Package DEB
262-
if: matrix.jobs.debian != ''
263-
run: |
264-
set -xeuo pipefail
265-
sudo gem install fpm
266-
cp .github/release/.fpm_systemd .fpm
267-
268-
fpm -t deb \
269-
-v "${PackageVersion}" \
270-
-p "mihomo-${{matrix.jobs.goos}}-${{matrix.jobs.output}}-${VERSION}.deb" \
271-
--architecture ${{ matrix.jobs.debian }} \
272-
mihomo=/usr/bin/mihomo
273-
274-
- name: Package RPM
275-
if: matrix.jobs.rpm != ''
276-
run: |
277-
set -xeuo pipefail
278-
sudo gem install fpm
279-
cp .github/release/.fpm_systemd .fpm
280-
281-
fpm -t rpm \
282-
-v "${PackageVersion}" \
283-
-p "mihomo-${{matrix.jobs.goos}}-${{matrix.jobs.output}}-${VERSION}.rpm" \
284-
--architecture ${{ matrix.jobs.rpm }} \
285-
mihomo=/usr/bin/mihomo
286-
287-
- name: Package Pacman
288-
if: matrix.jobs.pacman != ''
289-
run: |
290-
set -xeuo pipefail
291-
sudo gem install fpm
292-
sudo apt-get update && sudo apt-get install -y libarchive-tools
293-
cp .github/release/.fpm_systemd .fpm
294-
295-
fpm -t pacman \
296-
-v "${PackageVersion}" \
297-
-p "mihomo-${{matrix.jobs.goos}}-${{matrix.jobs.output}}-${VERSION}.pkg.tar.zst" \
298-
--architecture ${{ matrix.jobs.pacman }} \
299-
mihomo=/usr/bin/mihomo
249+
300250

301251
- name: Save version
302252
run: |
@@ -492,9 +442,9 @@ jobs:
492442
- name: login to docker REGISTRY
493443
uses: docker/login-action@v3
494444
with:
495-
registry: ${{ env.REGISTRY }}
496-
username: ${{ secrets.DOCKER_HUB_USER }}
497-
password: ${{ secrets.DOCKER_HUB_TOKEN }}
445+
registry: ghcr.io
446+
username: ${{ github.actor }}
447+
password: ${{ secrets.GITHUB_TOKEN }}
498448

499449
# Build and push Docker image with Buildx (don't push on PR)
500450
# https://github.com/docker/build-push-action

.github/workflows/trigger-cmfa-update.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

adapter/outboundgroup/parser.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package outboundgroup
33
import (
44
"errors"
55
"fmt"
6+
"slices"
67
"strings"
78

89
"github.com/dlclark/regexp2"
@@ -138,7 +139,7 @@ func ParseProxyGroup(config map[string]any, proxyMap map[string]C.Proxy, provide
138139
} else {
139140
addTestUrlToProviders(PDs, groupOption.URL, expectedStatus, groupOption.Filter, uint(groupOption.Interval))
140141
}
141-
providers = append(providers, PDs...)
142+
providers = slices.Concat(providers, PDs)
142143
}
143144

144145
if len(groupOption.Proxies) != 0 {
@@ -169,7 +170,7 @@ func ParseProxyGroup(config map[string]any, proxyMap map[string]C.Proxy, provide
169170
return nil, fmt.Errorf("%s: %w", groupName, err)
170171
}
171172

172-
providers = append([]types.ProxyProvider{pd}, providers...)
173+
providers = slices.Concat([]types.ProxyProvider{pd}, providers)
173174
providersMap[groupName] = pd
174175
}
175176

component/updater/update_core.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ var (
4141
backupExeName string // 备份文件名
4242
updateExeName string // 更新后的可执行文件
4343

44-
baseURL string = "https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/mihomo"
45-
versionURL string = "https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/version.txt"
44+
baseURL string = "https://github.com/Larvan2/Clash.Meta/releases/download/Prerelease-Alpha/mihomo"
45+
versionURL string = "https://github.com/Larvan2/Clash.Meta/releases/download/Prerelease-Alpha/version.txt"
4646
packageURL string
4747
latestVersion string
4848
)

log/log.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ func init() {
1919
log.SetOutput(os.Stdout)
2020
log.SetLevel(log.DebugLevel)
2121
log.SetFormatter(&log.TextFormatter{
22-
FullTimestamp: true,
23-
TimestampFormat: "2006-01-02T15:04:05.000000000Z07:00",
24-
EnvironmentOverrideColors: true,
22+
FullTimestamp: true,
23+
TimestampFormat: "UTC-07:00 2006-01-02 15:04:05",
24+
ForceColors: true,
2525
})
2626
}
2727

0 commit comments

Comments
 (0)