-
Notifications
You must be signed in to change notification settings - Fork 88
executable file
·73 lines (60 loc) · 3.45 KB
/
Update-CI.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
name: Update-CI
on:
schedule:
- cron: 0 16 * * *
watch:
types: [started]
#push:
# branches:
# - master
jobs:
build:
runs-on: ubuntu-latest
if: github.event.repository.owner.id == github.event.sender.id || ! github.event.sender.id
steps:
- uses: actions/checkout@master
- name: Run generate script
run: |
wget https://raw.githubusercontent.com/Loyalsoldier/geoip/release/geoip-only-cn-private.dat -nv -O ./dat/geoip.dat
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -nv -O ./dat/geosite.dat
#geosite_cn
wget 'https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/direct-list.txt' -nv -O ./luci-app-mosdns/root/etc/mosdns/rule/geosite_cn.txt
cp -rf ./luci-app-mosdns/root/etc/mosdns/rule/geosite_cn.txt ./dat/geosite_cn.txt
#geosite_no_cn
wget 'https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/proxy-list.txt' -nv -O ./luci-app-mosdns/root/etc/mosdns/rule/geosite_no_cn.txt
cp -rf ./luci-app-mosdns/root/etc/mosdns/rule/geosite_no_cn.txt ./dat/geosite_no_cn.txt
#geoip_cn
wget 'https://raw.githubusercontent.com/QiuSimons/Chnroute/master/dist/chnroute/chnroute.txt' -nv -O ./luci-app-mosdns/root/etc/mosdns/rule/geoip_cn.txt
wget 'https://raw.githubusercontent.com/QiuSimons/Chnroute/master/dist/chnroute/chnroute-v6.txt' -nv -O ./luci-app-mosdns/root/etc/mosdns/rule/chnroute-v6.txt
cat ./luci-app-mosdns/root/etc/mosdns/rule/chnroute-v6.txt >> ./luci-app-mosdns/root/etc/mosdns/rule/geoip_cn.txt
rm ./luci-app-mosdns/root/etc/mosdns/rule/chnroute-v6.txt
cp -rf ./luci-app-mosdns/root/etc/mosdns/rule/geoip_cn.txt ./dat/geoip_cn.txt
#adlist
wget 'https://anti-ad.net/domains.txt' -nv -O ./luci-app-mosdns/root/etc/mosdns/antiad.txt
cat ./luci-app-mosdns/root/etc/mosdns/antiad.txt ./luci-app-mosdns/root/etc/mosdns/yoyo.txt | sort | uniq > ./luci-app-mosdns/root/etc/mosdns/rule/serverlist.txt
rm -rf ./luci-app-mosdns/root/etc/mosdns/antiad.txt
sed -i '/#/d' ./luci-app-mosdns/root/etc/mosdns/rule/serverlist.txt
sed -i '/:/d' ./luci-app-mosdns/root/etc/mosdns/rule/serverlist.txt
sed -i '/cm.bilibili.com/d' ./luci-app-mosdns/root/etc/mosdns/rule/serverlist.txt
cp -rf ./luci-app-mosdns/root/etc/mosdns/rule/serverlist.txt ./dat/serverlist.txt
cp -rf ./luci-app-mosdns/root/usr/share/mosdns/def_config_orig.yaml ./dat/def_config_v5.yaml
latest_commit="$(curl -s https://api.github.com/repos/IrineSistiana/mosdns/commits/main | jq -r '.sha' | cut -b 1-7)"
sed -i '/PKG_VERSION:/d' ./mosdns/Makefile
sed -i "7 a PKG_VERSION:=$latest_commit" ./mosdns/Makefile
chmod -R 755 ./luci-app-mosdns/root/usr/share/mosdns/*.sh
- name: Commit file
run: |
git config --global user.email [email protected]
git config --global user.name SimonsQiu
git add .
git commit -m "Update `date +%Y/%m/%d\ %H:%M:%S\ %Z`" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{secrets.GITHUB_TOKEN}}
- name: Cleanup Workflow Logs
uses: Mattraks/delete-workflow-runs@main
with:
token: ${{secrets.GITHUB_TOKEN}}
repository: ${{ github.repository }}
retain_days: 1