Skip to content

Commit 140f97e

Browse files
committed
Update clash_singbox-tools
0 parents  commit 140f97e

6 files changed

+1177
-0
lines changed
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Delete old workflows
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 22 * * *'
6+
7+
jobs:
8+
del_runs:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
actions: write
12+
steps:
13+
- name: Delete old workflow runs
14+
uses: Mattraks/delete-workflow-runs@v2
15+
with:
16+
token: ${{ github.token }}
17+
repository: ${{ github.repository }}
18+
retain_days: 3
19+
keep_minimum_runs: 1
+278
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
name: Update AdGuard Home
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: "0 17 * * *"
6+
push:
7+
branches:
8+
- main
9+
paths-ignore:
10+
- "README.md"
11+
- ".github/workflows/delete-old-workflows.yml"
12+
- ".github/workflows/update-clashdashboard.yml"
13+
- ".github/workflows/update-mihomo.yml"
14+
- ".github/workflows/update-singbox.yml"
15+
16+
jobs:
17+
go:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
version: ${{ steps.go.outputs.version }}
21+
steps:
22+
- name: Get `Go` latest version
23+
id: go
24+
run: |
25+
echo version=$(curl -sSL https://raw.githubusercontent.com/actions/go-versions/update-versions-manifest-file/versions-manifest.json | grep '"version"' | head -1 | awk -F'"' '{print $4}') >> $GITHUB_OUTPUT
26+
27+
node:
28+
runs-on: ubuntu-latest
29+
outputs:
30+
version: ${{ steps.node.outputs.version }}
31+
steps:
32+
- name: Get `Node` latest version (LTS)
33+
id: node
34+
run: |
35+
echo version=$(curl -sSL https://nodejs.org/dist/index.json | jq -r 'map(select(.lts != false)) | .[0].version') >> $GITHUB_OUTPUT
36+
37+
release:
38+
runs-on: ubuntu-latest
39+
needs: go
40+
outputs:
41+
release_version: ${{ steps.release.outputs.release_version }}
42+
steps:
43+
- name: Checkout `beta-v0.107`
44+
uses: actions/checkout@v4
45+
with:
46+
repository: AdguardTeam/AdGuardHome
47+
ref: beta-v0.107
48+
fetch-depth: 0
49+
50+
- name: Setup `Go`
51+
uses: actions/setup-go@v5
52+
with:
53+
go-version: ${{ needs.go.outputs.version }}
54+
55+
- name: Get `AdGuard Home Release` version
56+
id: release
57+
run: |
58+
release_version=$(git describe --tags --abbrev=0 HEAD)
59+
echo release_version=$release_version >> $GITHUB_OUTPUT
60+
61+
release_cross:
62+
runs-on: ubuntu-latest
63+
strategy:
64+
matrix:
65+
include:
66+
# Linux
67+
- { name: linux_amd64, goos: linux, goarch: amd64, goamd64: v1 }
68+
- { name: linux_armv5, goos: linux, goarch: arm, goarm: 5 }
69+
- { name: linux_armv6, goos: linux, goarch: arm, goarm: 6 }
70+
- { name: linux_armv7, goos: linux, goarch: arm, goarm: 7 }
71+
- { name: linux_arm64, goos: linux, goarch: arm64 }
72+
- { name: linux_mips_softfloat, goos: linux, goarch: mips, gomips: softfloat }
73+
- { name: linux_mipsle_softfloat, goos: linux, goarch: mipsle, gomips: softfloat }
74+
# Windows
75+
- { name: windows_amd64, goos: windows, goarch: amd64, goamd64: v1 }
76+
- { name: windows_arm64, goos: windows, goarch: arm64 }
77+
78+
fail-fast: false
79+
needs:
80+
- go
81+
- node
82+
- release
83+
env:
84+
release_VERSION: ${{ needs.release.outputs.release_version }}
85+
steps:
86+
- name: Checkout `beta-v0.107`
87+
uses: actions/checkout@v4
88+
with:
89+
repository: AdguardTeam/AdGuardHome
90+
ref: beta-v0.107
91+
fetch-depth: 1
92+
93+
- name: Setup `Go`
94+
uses: actions/setup-go@v5
95+
with:
96+
go-version: ${{ needs.go.outputs.version }}
97+
98+
- name: Adapt `Go` version
99+
run: |
100+
go get go@${{ needs.go.outputs.version }}
101+
go mod tidy
102+
103+
- name: Setup `Node`
104+
uses: actions/setup-node@v4
105+
with:
106+
node-version: ${{ needs.node.outputs.version }}
107+
108+
- name: Setup `Snapcraft`
109+
run: |
110+
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
111+
112+
- name: Build `AdGuard Home Release`
113+
id: build
114+
run: |
115+
make SIGN=0 VERBOSE=1 ARCH=${{ matrix.goarch }} OS=${{ matrix.goos }} CHANNEL=release VERSION=${{ env.release_VERSION }} GOTOOLCHAIN=local build-release
116+
117+
- name: Upload files to workspace
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: AdGuardHome_release_${{ matrix.name }}
121+
path: '**/AdGuardHome/AdGuardHome*'
122+
compression-level: 9
123+
124+
beta:
125+
runs-on: ubuntu-latest
126+
needs: go
127+
outputs:
128+
beta_version: ${{ steps.beta.outputs.beta_version }}
129+
steps:
130+
- name: Checkout `beta-v0.108`
131+
uses: actions/checkout@v4
132+
with:
133+
repository: AdguardTeam/AdGuardHome
134+
ref: beta-v0.108
135+
fetch-depth: 0
136+
137+
- name: Setup `Go`
138+
uses: actions/setup-go@v5
139+
with:
140+
go-version: ${{ needs.go.outputs.version }}
141+
142+
- name: Get `AdGuard Home Beta` version
143+
id: beta
144+
run: |
145+
beta_version=$(git describe --tags --abbrev=0 HEAD)
146+
echo beta_version=$beta_version >> $GITHUB_OUTPUT
147+
148+
beta_cross:
149+
runs-on: ubuntu-latest
150+
strategy:
151+
matrix:
152+
include:
153+
# Linux
154+
- { name: linux_amd64, goos: linux, goarch: amd64, goamd64: v1 }
155+
- { name: linux_armv5, goos: linux, goarch: arm, goarm: 5 }
156+
- { name: linux_armv6, goos: linux, goarch: arm, goarm: 6 }
157+
- { name: linux_armv7, goos: linux, goarch: arm, goarm: 7 }
158+
- { name: linux_arm64, goos: linux, goarch: arm64 }
159+
- { name: linux_mips_softfloat, goos: linux, goarch: mips, gomips: softfloat }
160+
- { name: linux_mipsle_softfloat, goos: linux, goarch: mipsle, gomips: softfloat }
161+
# Windows
162+
- { name: windows_amd64, goos: windows, goarch: amd64, goamd64: v1 }
163+
- { name: windows_arm64, goos: windows, goarch: arm64 }
164+
165+
fail-fast: false
166+
needs:
167+
- go
168+
- node
169+
- beta
170+
env:
171+
beta_VERSION: ${{ needs.beta.outputs.beta_version }}
172+
steps:
173+
- name: Checkout `beta-v0.108`
174+
uses: actions/checkout@v4
175+
with:
176+
repository: AdguardTeam/AdGuardHome
177+
ref: beta-v0.108
178+
fetch-depth: 1
179+
180+
- name: Setup `Go`
181+
uses: actions/setup-go@v5
182+
with:
183+
go-version: ${{ needs.go.outputs.version }}
184+
185+
- name: Adapt `Go` version
186+
run: |
187+
go get go@${{ needs.go.outputs.version }}
188+
go mod tidy
189+
190+
- name: Setup `Node`
191+
uses: actions/setup-node@v4
192+
with:
193+
node-version: ${{ needs.node.outputs.version }}
194+
195+
- name: Setup `Snapcraft`
196+
run: |
197+
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
198+
199+
- name: Build `AdGuard Home Beta`
200+
id: build
201+
run: |
202+
make SIGN=0 VERBOSE=1 ARCH=${{ matrix.goarch }} OS=${{ matrix.goos }} CHANNEL=beta VERSION=${{ env.beta_VERSION }} GOTOOLCHAIN=local build-release
203+
204+
- name: Upload files to workspace
205+
uses: actions/upload-artifact@v4
206+
with:
207+
name: AdGuardHome_beta_${{ matrix.name }}
208+
path: '**/AdGuardHome/AdGuardHome*'
209+
compression-level: 9
210+
211+
push_adguardhome:
212+
needs:
213+
- release_cross
214+
- release
215+
- beta_cross
216+
- beta
217+
runs-on: ubuntu-latest
218+
env:
219+
release_VERSION: ${{ needs.release.outputs.release_version }}
220+
beta_VERSION: ${{ needs.beta.outputs.beta_version }}
221+
steps:
222+
- name: Clone Repository
223+
uses: actions/checkout@main
224+
225+
- name: Download files from workspace
226+
uses: actions/download-artifact@v4
227+
with:
228+
path: ./tmp-AdGuardHome/
229+
230+
- name: Batch move and rename `AdGuard Home` files
231+
run: |
232+
mkdir -p ./tmp-AdGuardHome/compress/
233+
archs=(amd64 armv5 armv6 armv7 arm64 mips_softfloat mipsle_softfloat)
234+
new_name=(amd64 armv5 armv6 armv7 armv8 mips_softfloat mipsle_softfloat)
235+
for ((i = 0; i < 7; i++)); do
236+
mv -f "./tmp-AdGuardHome/AdGuardHome_release_linux_${archs[i]}/dist/AdGuardHome_linux_${archs[i]//v/_}/AdGuardHome/AdGuardHome" "./tmp-AdGuardHome/compress/AdGuardHome_release_linux_${new_name[i]}"
237+
mv -f "./tmp-AdGuardHome/AdGuardHome_beta_linux_${archs[i]}/dist/AdGuardHome_linux_${archs[i]//v/_}/AdGuardHome/AdGuardHome" "./tmp-AdGuardHome/compress/AdGuardHome_beta_linux_${new_name[i]}"
238+
done
239+
chmod +x ./tmp-AdGuardHome/compress/*
240+
241+
- name: Setup `upx` and compress `AdGuard Home` files
242+
uses: crazy-max/ghaction-upx@v3
243+
with:
244+
version: latest
245+
files: ./tmp-AdGuardHome/compress/*
246+
247+
- name: Move `AdGuard Home` files
248+
run: |
249+
mkdir -p ./AdGuardHome/
250+
mv -f ./tmp-AdGuardHome/compress/* ./AdGuardHome/
251+
# `Release` for Windows
252+
mv -f ./tmp-AdGuardHome/AdGuardHome_release_windows_amd64/dist/AdGuardHome_windows_amd64/AdGuardHome/AdGuardHome.exe ./AdGuardHome/AdGuardHome_release_windows_amd64.exe
253+
mv -f ./tmp-AdGuardHome/AdGuardHome_release_windows_arm64/dist/AdGuardHome_windows_arm64/AdGuardHome/AdGuardHome.exe ./AdGuardHome/AdGuardHome_release_windows_arm64.exe
254+
255+
# `Beta` for Windows
256+
mv -f ./tmp-AdGuardHome/AdGuardHome_beta_windows_amd64/dist/AdGuardHome_windows_amd64/AdGuardHome/AdGuardHome.exe ./AdGuardHome/AdGuardHome_beta_windows_amd64.exe
257+
mv -f ./tmp-AdGuardHome/AdGuardHome_beta_windows_arm64/dist/AdGuardHome_windows_arm64/AdGuardHome/AdGuardHome.exe ./AdGuardHome/AdGuardHome_beta_windows_arm64.exe
258+
rm -rf ./tmp*
259+
260+
- name: Release and upload `AdGuardHome` assets
261+
uses: svenstaro/upload-release-action@v2
262+
with:
263+
repo_token: ${{ secrets.GITHUB_TOKEN }}
264+
release_name: AdGuardHome
265+
tag: AdGuardHome
266+
overwrite: true
267+
body: |
268+
[AdGuardHome](https://github.com/AdguardTeam/AdGuardHome) Release 版和 Beta 版
269+
更新 AdGuard Home Release 版至 ${{ env.release_VERSION }},更新 AdGuard Home Beta 版至 ${{ env.beta_VERSION }}
270+
file_glob: true
271+
file: ./AdGuardHome/*
272+
273+
- name: Purge jsDelivr CDN
274+
run: |
275+
cd ./AdGuardHome/ || exit 1
276+
for file in $(ls); do
277+
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@AdGuardHome/${file}"
278+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Update Clash Dashboard
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: "30 17 * * *"
6+
push:
7+
branches:
8+
- main
9+
paths-ignore:
10+
- "README.md"
11+
- ".github/workflows/delete-old-workflows.yml"
12+
- ".github/workflows/update-adguardhome.yml"
13+
- ".github/workflows/update-mihomo.yml"
14+
- ".github/workflows/update-singbox.yml"
15+
16+
jobs:
17+
Update:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Clone Repository
21+
uses: actions/checkout@main
22+
23+
- name: Get version
24+
run: |
25+
razord_meta_download_version=$(curl -sSL https://api.github.com/repos/MetaCubeX/Razord-meta/tags | grep 'name' | head -n 1 | sed -e 's/.*v/v/' -e 's/".*//')
26+
echo "razord_meta_download_version=${razord_meta_download_version}" >> ${GITHUB_ENV}
27+
yacd_download_version=$(curl -sSL https://api.github.com/repos/haishanh/yacd/releases/latest | grep 'tag_name' | sed -e 's/.*v/v/' -e 's/".*//')
28+
echo "yacd_download_version=${yacd_download_version}" >> ${GITHUB_ENV}
29+
yacd_meta_download_version=$(curl -sSL https://api.github.com/repos/MetaCubeX/Yacd-meta/releases/latest | grep 'tag_name' | sed -e 's/.*v/v/' -e 's/".*//')
30+
echo "yacd_meta_download_version=${yacd_meta_download_version}" >> ${GITHUB_ENV}
31+
metacubexd_download_version=$(curl -sSL https://api.github.com/repos/MetaCubeX/metacubexd/releases/latest | grep 'tag_name' | sed -e 's/.*v/v/' -e 's/".*//')
32+
echo "metacubexd_download_version=${metacubexd_download_version}" >> ${GITHUB_ENV}
33+
34+
- name: Download and compress `Razord-meta` dashboard
35+
run: |
36+
mkdir -p ./Dashboard/ ./tmp/Razord-meta/
37+
curl -o ./tmp/Razord-meta/gh-pages.zip -L https://github.com/MetaCubeX/Razord-meta/archive/refs/heads/gh-pages.zip
38+
unzip -o ./tmp/Razord-meta/gh-pages.zip -d ./tmp/Razord-meta/
39+
tar -czf ./Dashboard/Razord-meta.tar.gz -C ./tmp/Razord-meta/Razord-meta-gh-pages/ .
40+
41+
- name: Download and compress `yacd` dashboard
42+
run: |
43+
mkdir -p ./tmp/yacd/
44+
curl -o ./tmp/yacd/gh-pages.zip -L https://github.com/haishanh/yacd/archive/refs/heads/gh-pages.zip
45+
unzip -o ./tmp/yacd/gh-pages.zip -d ./tmp/yacd/
46+
tar -czf ./Dashboard/yacd.tar.gz -C ./tmp/yacd/yacd-gh-pages/ .
47+
48+
- name: Download and compress `Yacd-meta` dashboard
49+
run: |
50+
mkdir -p ./tmp/Yacd-meta/
51+
curl -o ./tmp/Yacd-meta/gh-pages.zip -L https://github.com/MetaCubeX/Yacd-meta/archive/refs/heads/gh-pages.zip
52+
unzip -o ./tmp/Yacd-meta/gh-pages.zip -d ./tmp/Yacd-meta/
53+
tar -czf ./Dashboard/Yacd-meta.tar.gz -C ./tmp/Yacd-meta/Yacd-meta-gh-pages/ .
54+
55+
- name: Download and compress `metacubexd` dashboard
56+
run: |
57+
mkdir -p ./tmp/metacubexd/
58+
curl -o ./tmp/metacubexd/gh-pages.zip -L https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip
59+
unzip -o ./tmp/metacubexd/gh-pages.zip -d ./tmp/metacubexd/
60+
tar -czf ./Dashboard/metacubexd.tar.gz -C ./tmp/metacubexd/metacubexd-gh-pages/ .
61+
rm -rf ./tmp*
62+
63+
- name: Release and upload `Dashboard` assets
64+
uses: svenstaro/upload-release-action@v2
65+
with:
66+
repo_token: ${{ secrets.GITHUB_TOKEN }}
67+
release_name: Dashboard
68+
tag: Dashboard
69+
overwrite: true
70+
body: |
71+
Clash Dashboard,包括:[Razord-meta 面板](https://github.com/MetaCubeX/Razord-meta)、[yacd 面板](https://github.com/haishanh/yacd)、[Yacd-meta 面板](https://github.com/MetaCubeX/Yacd-meta)和 [metacubexd 面板](https://github.com/MetaCubeX/metacubexd)
72+
更新 Razord-meta 面板至 ${{ env.razord_meta_download_version }}
73+
更新 yacd 面板至 ${{ env.yacd_download_version }}
74+
更新 Yacd-meta 面板至 ${{ env.yacd_meta_download_version }}
75+
更新 metacubexd 面板至 ${{ env.metacubexd_download_version }}
76+
file_glob: true
77+
file: ./Dashboard/*
78+
79+
- name: Purge jsDelivr CDN
80+
run: |
81+
cd ./Dashboard/ || exit 1
82+
for file in $(ls); do
83+
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@Dashboard/${file}"
84+
done

0 commit comments

Comments
 (0)