-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (47 loc) · 2.02 KB
/
Copy pathModule.yml
File metadata and controls
59 lines (47 loc) · 2.02 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
48
49
50
51
52
53
54
55
56
57
58
59
name: Module
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 下载代码
uses: actions/checkout@v6
- name: 获取 commit hash
run: |
echo "SHORT_HASH=$(git rev-parse --short=6 HEAD)" >> $GITHUB_ENV
- name: 注入 module.prop 版本 hash
run: |
HASH=$SHORT_HASH
sed -i "s/^version=.*/version=2.2.2-${HASH}/" ClashRoot/module.prop
- 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: |
HASH=$SHORT_HASH
(cd ClashRoot && zip -r ../ClashRoot-${HASH}.zip .)
- name: 上传 ZIP
uses: actions/upload-artifact@v7
with:
path: ClashRoot-*.zip
archive: false