-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (39 loc) · 1.7 KB
/
Copy pathModule.yml
File metadata and controls
47 lines (39 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Module
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 下载代码
uses: actions/checkout@v6
- name: 下载 GeoIP 和 Geosite
run: |
mkdir -p ClashRoot
curl -L -o ClashRoot/geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
curl -L -o ClashRoot/geosite.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
- name: 下载最新版本Clash
run: |
RELEASE_JSON=$(curl -s https://api.github.com/repos/MetaCubeX/mihomo/releases/latest)
CLASH_URL=$(echo "$RELEASE_JSON" | grep -oP '"browser_download_url": "\K.*?mihomo-android-arm64-v8-v[0-9]+\.[0-9]+\.[0-9]+\.gz(?=")' | head -n 1)
echo "Downloading Clash: $CLASH_URL"
curl -L -o ClashRoot/clash.gz "$CLASH_URL"
gunzip -f ClashRoot/clash.gz
chmod +x ClashRoot/clash
- name: 下载最新版本MetaCubeXD
run: |
RELEASE_JSON=$(curl -s https://api.github.com/repos/MetaCubeX/metacubexd/releases/latest)
METACUBEXD_URL=$(echo "$RELEASE_JSON" | grep -oP '"browser_download_url": "\K.*?compressed-dist.tgz(?=")' | head -n 1)
echo "Downloading MetaCubeXD: $METACUBEXD_URL"
mkdir -p ClashRoot/metacubexd
curl -L -o metacubexd.tgz "$METACUBEXD_URL"
tar -xzf metacubexd.tgz -C ClashRoot/metacubexd
rm metacubexd.tgz
- name: 打包 ClashRoot.zip
run: |
(cd ClashRoot && zip -r ../ClashRoot.zip .)
- name: 上传产物
uses: actions/upload-artifact@v7
with:
path: ClashRoot.zip
archive: false