@@ -22,7 +22,7 @@ concurrency:
2222 cancel-in-progress : true
2323
2424env :
25- REGISTRY : docker .io
25+ REGISTRY : ghcr .io
2626jobs :
2727 build :
2828 runs-on : ubuntu-latest
@@ -36,22 +36,11 @@ 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}
44- - { goos: linux, goarch: mips, gomips: hardfloat, output: mips-hardfloat }
45- - { goos: linux, goarch: mips, gomips: softfloat, output: mips-softfloat }
46- - { goos: linux, goarch: mipsle, gomips: hardfloat, output: mipsle-hardfloat }
47- - { goos: linux, goarch: mipsle, gomips: softfloat, output: mipsle-softfloat }
48- - { 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 }
42+ - { goos: linux, goarch: arm, goarm: '6', output: armv6 }
43+ - { goos: linux, goarch: arm, goarm: '7', output: armv7 }
5544
5645 - { goos: windows, goarch: '386', output: '386' }
5746 - { goos: windows, goarch: amd64, goamd64: v1, output: amd64-compatible }
6857 - { goos: android, goarch: arm, ndk: armv7a-linux-androideabi34, output: armv7 }
6958 - { goos: android, goarch: arm64, ndk: aarch64-linux-android34, output: arm64-v8 }
7059
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-
77- # Go 1.22 with special patch can work on Windows 7
78- # https://github.com/MetaCubeX/go/commits/release-branch.go1.22/
79- - { goos: windows, goarch: '386', output: '386-go122', goversion: '1.22' }
80- - { goos: windows, goarch: amd64, goamd64: v1, output: amd64-compatible-go122, goversion: '1.22' }
81- - { goos: windows, goarch: amd64, goamd64: v3, output: amd64-go122, goversion: '1.22' }
82-
83- # Go 1.21 can revert commit `9e4385` to work on Windows 7
84- # https://github.com/golang/go/issues/64622#issuecomment-1847475161
85- # (OR we can just use golang1.21.4 which unneeded any patch)
86- - { goos: windows, goarch: '386', output: '386-go121', goversion: '1.21' }
87- - { goos: windows, goarch: amd64, goamd64: v1, output: amd64-compatible-go121, goversion: '1.21' }
88- - { goos: windows, goarch: amd64, goamd64: v3, output: amd64-go121, goversion: '1.21' }
89-
90- # Go 1.20 is the last release that will run on any release of Windows 7, 8, Server 2008 and Server 2012. Go 1.21 will require at least Windows 10 or Server 2016.
91- - { goos: windows, goarch: '386', output: '386-go120', goversion: '1.20' }
92- - { goos: windows, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, goversion: '1.20' }
93- - { goos: windows, goarch: amd64, goamd64: v3, output: amd64-go120, goversion: '1.20' }
94-
95- # Go 1.22 is the last release that will run on macOS 10.15 Catalina. Go 1.23 will require macOS 11 Big Sur or later.
96- - { goos: darwin, goarch: arm64, output: arm64-go122, goversion: '1.22' }
97- - { goos: darwin, goarch: amd64, goamd64: v1, output: amd64-compatible-go122, goversion: '1.22' }
98- - { goos: darwin, goarch: amd64, goamd64: v3, output: amd64-go122, goversion: '1.22' }
99-
100- # Go 1.20 is the last release that will run on macOS 10.13 High Sierra or 10.14 Mojave. Go 1.21 will require macOS 10.15 Catalina or later.
101- - { goos: darwin, goarch: arm64, output: arm64-go120, goversion: '1.20' }
102- - { goos: darwin, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, goversion: '1.20' }
103- - { goos: darwin, goarch: amd64, goamd64: v3, output: amd64-go120, goversion: '1.20' }
104-
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-
110- # only for test
111- - { goos: linux, goarch: '386', output: '386-go120', goversion: '1.20' }
112- - { goos: linux, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, goversion: '1.20', test: test }
113- - { goos: linux, goarch: amd64, goamd64: v3, output: amd64-go120, goversion: '1.20' }
114-
11560 steps :
11661 - uses : actions/checkout@v4
11762
@@ -127,74 +72,6 @@ jobs:
12772 with :
12873 go-version : ${{ matrix.jobs.goversion }}
12974
130- - name : Set up Go1.24 loongarch abi1
131- if : ${{ matrix.jobs.goarch == 'loong64' && matrix.jobs.abi == '1' }}
132- run : |
133- wget -q https://github.com/MetaCubeX/loongarch64-golang/releases/download/1.24.0/go1.24.0.linux-amd64-abi1.tar.gz
134- sudo tar zxf go1.24.0.linux-amd64-abi1.tar.gz -C /usr/local
135- echo "/usr/local/go/bin" >> $GITHUB_PATH
136-
137- # modify from https://github.com/restic/restic/issues/4636#issuecomment-1896455557
138- # this patch file only works on golang1.24.x
139- # that means after golang1.25 release it must be changed
140- # see: https://github.com/MetaCubeX/go/commits/release-branch.go1.24/
141- # revert:
142- # 693def151adff1af707d82d28f55dba81ceb08e1: "crypto/rand,runtime: switch RtlGenRandom for ProcessPrng"
143- # 7c1157f9544922e96945196b47b95664b1e39108: "net: remove sysSocket fallback for Windows 7"
144- # 48042aa09c2f878c4faa576948b07fe625c4707a: "syscall: remove Windows 7 console handle workaround"
145- # a17d959debdb04cd550016a3501dd09d50cd62e7: "runtime: always use LoadLibraryEx to load system libraries"
146- - name : Revert Golang1.24 commit for Windows7/8
147- if : ${{ matrix.jobs.goos == 'windows' && matrix.jobs.goversion == '' }}
148- run : |
149- cd $(go env GOROOT)
150- curl https://github.com/MetaCubeX/go/commit/2a406dc9f1ea7323d6ca9fccb2fe9ddebb6b1cc8.diff | patch --verbose -p 1
151- curl https://github.com/MetaCubeX/go/commit/7b1fd7d39c6be0185fbe1d929578ab372ac5c632.diff | patch --verbose -p 1
152- curl https://github.com/MetaCubeX/go/commit/979d6d8bab3823ff572ace26767fd2ce3cf351ae.diff | patch --verbose -p 1
153- curl https://github.com/MetaCubeX/go/commit/ac3e93c061779dfefc0dd13a5b6e6f764a25621e.diff | patch --verbose -p 1
154-
155- # modify from https://github.com/restic/restic/issues/4636#issuecomment-1896455557
156- # this patch file only works on golang1.23.x
157- # that means after golang1.24 release it must be changed
158- # see: https://github.com/MetaCubeX/go/commits/release-branch.go1.23/
159- # revert:
160- # 693def151adff1af707d82d28f55dba81ceb08e1: "crypto/rand,runtime: switch RtlGenRandom for ProcessPrng"
161- # 7c1157f9544922e96945196b47b95664b1e39108: "net: remove sysSocket fallback for Windows 7"
162- # 48042aa09c2f878c4faa576948b07fe625c4707a: "syscall: remove Windows 7 console handle workaround"
163- # a17d959debdb04cd550016a3501dd09d50cd62e7: "runtime: always use LoadLibraryEx to load system libraries"
164- - name : Revert Golang1.23 commit for Windows7/8
165- if : ${{ matrix.jobs.goos == 'windows' && matrix.jobs.goversion == '1.23' }}
166- run : |
167- cd $(go env GOROOT)
168- curl https://github.com/MetaCubeX/go/commit/9ac42137ef6730e8b7daca016ece831297a1d75b.diff | patch --verbose -p 1
169- curl https://github.com/MetaCubeX/go/commit/21290de8a4c91408de7c2b5b68757b1e90af49dd.diff | patch --verbose -p 1
170- curl https://github.com/MetaCubeX/go/commit/6a31d3fa8e47ddabc10bd97bff10d9a85f4cfb76.diff | patch --verbose -p 1
171- curl https://github.com/MetaCubeX/go/commit/69e2eed6dd0f6d815ebf15797761c13f31213dd6.diff | patch --verbose -p 1
172-
173- # modify from https://github.com/restic/restic/issues/4636#issuecomment-1896455557
174- # this patch file only works on golang1.22.x
175- # that means after golang1.23 release it must be changed
176- # see: https://github.com/MetaCubeX/go/commits/release-branch.go1.22/
177- # revert:
178- # 693def151adff1af707d82d28f55dba81ceb08e1: "crypto/rand,runtime: switch RtlGenRandom for ProcessPrng"
179- # 7c1157f9544922e96945196b47b95664b1e39108: "net: remove sysSocket fallback for Windows 7"
180- # 48042aa09c2f878c4faa576948b07fe625c4707a: "syscall: remove Windows 7 console handle workaround"
181- # a17d959debdb04cd550016a3501dd09d50cd62e7: "runtime: always use LoadLibraryEx to load system libraries"
182- - name : Revert Golang1.22 commit for Windows7/8
183- if : ${{ matrix.jobs.goos == 'windows' && matrix.jobs.goversion == '1.22' }}
184- run : |
185- cd $(go env GOROOT)
186- curl https://github.com/MetaCubeX/go/commit/9779155f18b6556a034f7bb79fb7fb2aad1e26a9.diff | patch --verbose -p 1
187- curl https://github.com/MetaCubeX/go/commit/ef0606261340e608017860b423ffae5c1ce78239.diff | patch --verbose -p 1
188- curl https://github.com/MetaCubeX/go/commit/7f83badcb925a7e743188041cb6e561fc9b5b642.diff | patch --verbose -p 1
189- curl https://github.com/MetaCubeX/go/commit/83ff9782e024cb328b690cbf0da4e7848a327f4f.diff | patch --verbose -p 1
190-
191- # modify from https://github.com/restic/restic/issues/4636#issuecomment-1896455557
192- - name : Revert Golang1.21 commit for Windows7/8
193- if : ${{ matrix.jobs.goos == 'windows' && matrix.jobs.goversion == '1.21' }}
194- run : |
195- cd $(go env GOROOT)
196- curl https://github.com/golang/go/commit/9e43850a3298a9b8b1162ba0033d4c53f8637571.diff | patch --verbose -R -p 1
197-
19875 - name : Set variables
19976 run : |
20077 VERSION="${GITHUB_REF_NAME,,}-$(git rev-parse --short HEAD)"
@@ -258,45 +135,7 @@ jobs:
258135 rm mihomo-${{matrix.jobs.goos}}-${{matrix.jobs.output}}
259136 fi
260137
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
138+
300139
301140 - name : Save version
302141 run : |
@@ -492,9 +331,9 @@ jobs:
492331 - name : login to docker REGISTRY
493332 uses : docker/login-action@v3
494333 with :
495- registry : ${{ env.REGISTRY }}
496- username : ${{ secrets.DOCKER_HUB_USER }}
497- password : ${{ secrets.DOCKER_HUB_TOKEN }}
334+ registry : ghcr.io
335+ username : ${{ github.actor }}
336+ password : ${{ secrets.GITHUB_TOKEN }}
498337
499338 # Build and push Docker image with Buildx (don't push on PR)
500339 # https://github.com/docker/build-push-action
0 commit comments