forked from ACL4SSR/ACL4SSR
-
Notifications
You must be signed in to change notification settings - Fork 23
117 lines (105 loc) · 3.97 KB
/
run.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Convert other rules to sing-box rule set
on:
workflow_dispatch:
schedule:
- cron: "30 14 * * *" # 6:30 AM UTC+8
push:
branches:
- workflow
paths-ignore:
- "**/README.md"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout scripts
uses: actions/checkout@v4
with:
repository: KaringX/karing-ruleset
path: workflow
ref: workflow
- name: Checkout ACL4SSR
uses: actions/checkout@v4
with:
repository: ACL4SSR/ACL4SSR
path: ACL4SSR
ref: master
- name: Convert json files
env:
NO_SKIP: true
run: |
mkdir -p ./sing-rule/ACL4SSR/Ruleset
cp ./workflow/resouces/convert_* ./sing-rule/ACL4SSR/
cd sing-rule/ACL4SSR/ || exit 1
python convert_json.py ../../ACL4SSR/Clash ./
- name: Convert json to srs
env:
NO_SKIP: true
run: |
cd sing-rule || exit 1
wget -q https://github.com/SagerNet/sing-box/releases/download/v1.10.0-beta.4/sing-box-1.10.0-beta.4-linux-amd64.tar.gz -O sing-box.tar.gz && tar zxvf sing-box.tar.gz && mv sing-box-1.10.0-beta.4-linux-amd64/sing-box ./
chmod 755 sing-box ACL4SSR/convert_srs.sh && ./ACL4SSR/convert_srs.sh ./sing-box
rm -rf LICENSE README.md ACL4SSR/convert_*
cp ./ACL4SSR/Ruleset/*.srs ./ACL4SSR
- name: Checkout meta-rules-dat
uses: actions/checkout@v4
with:
repository: MetaCubeX/meta-rules-dat
path: meta-rules-dat
ref: sing
- name: Checkout Iran-sing-box-rules
uses: actions/checkout@v4
with:
repository: Chocolate4U/Iran-sing-box-rules
path: Iran-sing-box-rules
ref: rule-set
- name: copy geo rules
env:
NO_SKIP: true
run: |
cd sing-rule || exit 1
cp -r ../meta-rules-dat/geo ./
bash ../workflow/resouces/merge_geo_ir.sh ./geo ../Iran-sing-box-rules/
- name: maker karing built-in rule-set group
env:
NO_SKIP: true
run: |
mkdir -p ./sing-rule/recommend
python workflow/resouces/kr_builtin_ruleset.py ./sing-rule/
- name: convert AdGuardSDNSFilter to srs
env:
NO_SKIP: true
run: |
python workflow/resouces/convert_adguard.py ./sing-rule/
- name: rm sing-box files
env:
NO_SKIP: true
run: |
cd sing-rule || exit 1
rm -rf sing-box* LICENSE README.md
- name: Git push assets to "sing-rule" branch
run: |
cd sing-rule || exit 1
cp ../workflow/README.md . && cp -r ../workflow/.github .
git init
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b sing
git add .
git commit -m "Released on ${{ env.BUILDTIME }}"
git remote add origin "https://${{ github.actor }}:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}"
git push -f -u origin sing
- name: Purge jsdelivr CDN
# find . -type f \( -name "*.json" -o -name "*.srs" \) -printf "%P\n" | while read file; do
# curl -i -Ls "https://purge.jsdelivr.net/gh/${{ github.repository }}@sing/${file}"
# echo -e "\t${file} PURGE...\n"
# done
run: |
cd sing-rule/ || exit 1
for file in $(ls); do
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@sing/${file}"
done
curl -i -Ls "https://purge.jsdelivr.net/gh/KaringX/karing-ruleset@sing/ACL4SSR"
curl -i -Ls "https://purge.jsdelivr.net/gh/KaringX/karing-ruleset@sing/ACL4SSR/Ruleset"
curl -i -Ls "https://purge.jsdelivr.net/gh/KaringX/karing-ruleset@sing/geo/geoip"
curl -i -Ls "https://purge.jsdelivr.net/gh/KaringX/karing-ruleset@sing/geo/geosite"