2023-03-21 15:19:30 +08:00
name : Build rules dat files
2019-12-13 15:23:54 +08:00
on :
2020-10-27 09:46:53 +08:00
workflow_dispatch :
2019-12-13 15:23:54 +08:00
schedule :
2019-12-22 22:09:23 +08:00
- cron : "0 22 * * *"
2019-12-13 23:26:24 +08:00
push :
branches :
2019-12-15 18:14:44 +08:00
- master
2020-07-07 10:38:09 +08:00
paths-ignore :
- "**/README.md"
2019-12-10 15:40:58 +08:00
jobs :
build :
2019-12-10 17:17:09 +08:00
runs-on : ubuntu-latest
2019-12-10 15:40:58 +08:00
steps :
2023-03-06 14:10:27 +08:00
- name : Setup Go 1.19.6
2022-04-11 11:52:42 +08:00
uses : actions/setup-go@v3
2019-12-10 15:40:58 +08:00
with :
2023-03-06 14:10:27 +08:00
go-version : 1.19 .6
2019-12-10 15:40:58 +08:00
2020-10-27 09:04:23 +08:00
- name : Set variables
2019-12-13 23:26:24 +08:00
run : |
2020-10-06 15:02:20 +08:00
echo "RELEASE_NAME=Released on $(date +%Y%m%d%H%M)" >> $GITHUB_ENV
echo "TAG_NAME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
2023-03-21 15:19:30 +08:00
echo "CHINA_DOMAINS_URL=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/ChinaMax/ChinaMax_Domain.txt" >> $GITHUB_ENV
2020-10-06 15:02:20 +08:00
echo "GOOGLE_DOMAINS_URL=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf" >> $GITHUB_ENV
echo "APPLE_DOMAINS_URL=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf" >> $GITHUB_ENV
2023-04-09 01:05:26 +08:00
# echo "EASYLISTCHINA_EASYLIST_REJECT_URL=https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt" >> $GITHUB_ENV
# echo "EASYPRIVACY_REJECT_URL=https://easylist-downloads.adblockplus.org/easyprivacy.txt" >> $GITHUB_ENV
# echo "PETERLOWE_REJECT_URL=https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext" >> $GITHUB_ENV
# echo "ADGUARD_DNS_REJECT_URL=https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt" >> $GITHUB_ENV
# echo "DANPOLLOCK_REJECT_URL=https://someonewhocares.org/hosts/hosts" >> $GITHUB_ENV
# echo "ANTIAD_DOMAINS_URL=https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt" >> $GITHUB_ENV
2020-10-27 09:04:23 +08:00
echo "CUSTOM_DIRECT=https://raw.githubusercontent.com/Loyalsoldier/domain-list-custom/release/cn.txt" >> $GITHUB_ENV
echo "CUSTOM_PROXY=https://raw.githubusercontent.com/Loyalsoldier/domain-list-custom/release/geolocation-!cn.txt" >> $GITHUB_ENV
2021-01-18 16:56:18 +08:00
echo "WIN_SPY=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt" >> $GITHUB_ENV
echo "WIN_UPDATE=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update.txt" >> $GITHUB_ENV
echo "WIN_EXTRA=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/extra.txt" >> $GITHUB_ENV
2019-12-13 23:26:24 +08:00
shell : bash
2019-12-11 02:56:31 +08:00
2020-10-27 09:04:23 +08:00
- name : Checkout the "hidden" branch of this repo
2022-03-02 16:35:46 +08:00
uses : actions/checkout@v3
2019-12-23 20:42:11 +08:00
with :
ref : hidden
2020-10-27 09:04:23 +08:00
- name : Checkout Loyalsoldier/domain-list-custom
2022-03-02 16:35:46 +08:00
uses : actions/checkout@v3
2020-10-27 09:04:23 +08:00
with :
repository : Loyalsoldier/domain-list-custom
path : custom
- name : Checkout v2fly/domain-list-community
2022-03-02 16:35:46 +08:00
uses : actions/checkout@v3
2020-10-27 09:04:23 +08:00
with :
repository : v2fly/domain-list-community
path : community
2021-04-21 17:19:21 +08:00
- name : Checkout cokebar/gfwlist2dnsmasq
2022-03-02 16:35:46 +08:00
uses : actions/checkout@v3
2021-04-21 17:19:21 +08:00
with :
repository : cokebar/gfwlist2dnsmasq
path : gfwlist2dnsmasq
- name : Generate GFWList domains
run : |
cd gfwlist2dnsmasq || exit 1
chmod +x ./gfwlist2dnsmasq.sh
./gfwlist2dnsmasq.sh -l -o ./temp-gfwlist.txt
2020-01-10 14:15:44 +08:00
- name : Get and add direct domains into temp-direct.txt file
run : |
2023-04-11 02:18:49 +08:00
curl -sSL ${CHINA_DOMAINS_URL} | sed '/^\s*#/d' | sed '/^[^\.]/ s/^/full:/' | sed 's/^\.\([^.]*\)/\1/' > temp-direct.txt
2021-01-21 17:38:16 +08:00
curl -sSL ${CUSTOM_DIRECT} | perl -ne '/^(domain):([^:]+)(\n$|:@.+)/ && print "$2\n"' >> temp-direct.txt
2020-01-10 14:15:44 +08:00
2020-01-10 13:22:40 +08:00
- name : Get and add proxy domains into temp-proxy.txt file
2019-12-13 23:26:24 +08:00
run : |
2021-04-21 17:19:21 +08:00
cat ./gfwlist2dnsmasq/temp-gfwlist.txt | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > temp-proxy.txt
2020-01-27 22:29:56 +08:00
curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
2021-01-21 17:38:16 +08:00
curl -sSL ${CUSTOM_PROXY} | grep -Ev ":@cn" | perl -ne '/^(domain):([^:]+)(\n$|:@.+)/ && print "$2\n"' >> temp-proxy.txt
2020-01-27 20:45:39 +08:00
2023-04-09 01:05:26 +08:00
# - name: Get and add reject domains into temp-reject.txt file
# run: |
# curl -sSL $EASYLISTCHINA_EASYLIST_REJECT_URL | perl -ne '/^\|\|([-_0-9a-zA-Z]+(\.[-_0-9a-zA-Z]+){1,64})\^$/ && print "$1\n"' | perl -ne 'print if not /^[0-9]{1,3}(\.[0-9]{1,3}){3}$/' > temp-reject.txt
# curl -sSL $EASYPRIVACY_REJECT_URL | perl -ne '/^\|\|([-_0-9a-zA-Z]+(\.[-_0-9a-zA-Z]+){1,64})\^$/ && print "$1\n"' | perl -ne 'print if not /^[0-9]{1,3}(\.[0-9]{1,3}){3}$/' >> temp-reject.txt
# curl -sSL $ADGUARD_DNS_REJECT_URL | perl -ne '/^\|\|([-_0-9a-zA-Z]+(\.[-_0-9a-zA-Z]+){1,64})\^$/ && print "$1\n"' | perl -ne 'print if not /^[0-9]{1,3}(\.[0-9]{1,3}){3}$/' >> temp-reject.txt
# curl -sSL $ANTIAD_DOMAINS_URL | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' >> temp-reject.txt
# curl -sSL $PETERLOWE_REJECT_URL | perl -ne '/^127\.0\.0\.1\s([-_0-9a-zA-Z]+(\.[-_0-9a-zA-Z]+){1,64})$/ && print "$1\n"' >> temp-reject.txt
# curl -sSL $DANPOLLOCK_REJECT_URL | perl -ne '/^127\.0\.0\.1\s([-_0-9a-zA-Z]+(\.[-_0-9a-zA-Z]+){1,64})/ && print "$1\n"' | sed '1d' >> temp-reject.txt
2020-08-03 19:14:25 +08:00
2021-01-21 17:38:16 +08:00
- name : Reserve `full`, `regexp` and `keyword` type of rules from custom lists to "reserve" files
2020-08-03 19:14:25 +08:00
run : |
2023-05-20 15:10:06 +08:00
curl -sSL ${CUSTOM_DIRECT} | grep -v google | grep -v "acg.rip" | perl -ne '/^((full|regexp|keyword):[^:]+)(\n$|:@.+)/ && print "$1\n"' | sort --ignore-case -u > direct-reserve.txt
2021-01-21 17:38:16 +08:00
curl -sSL ${CUSTOM_PROXY} | grep -Ev ":@cn" | perl -ne '/^((full|regexp|keyword):[^:]+)(\n$|:@.+)/ && print "$1\n"' | sort --ignore-case -u > proxy-reserve.txt
2019-12-14 01:33:23 +08:00
2020-03-10 10:47:42 +08:00
- name : Add proxy, direct and reject domains from "hidden" branch to appropriate temp files
2019-12-23 20:42:11 +08:00
run : |
cat proxy.txt >> temp-proxy.txt
cat direct.txt >> temp-direct.txt
2023-04-09 01:05:26 +08:00
# cat reject.txt >> temp-reject.txt
2019-12-23 20:42:11 +08:00
2020-03-02 01:05:01 +08:00
- name : Sort and generate redundant lists
2019-12-15 18:14:44 +08:00
run : |
2020-08-03 19:14:25 +08:00
cat temp-proxy.txt | sort --ignore-case -u > proxy-list-with-redundant
cat temp-direct.txt | sort --ignore-case -u > direct-list-with-redundant
2023-04-09 01:05:26 +08:00
# cat temp-reject.txt | sort --ignore-case -u > reject-list-with-redundant
2019-12-15 18:14:44 +08:00
2020-03-02 01:05:01 +08:00
- name : Remove redundant domains
run : |
chmod +x findRedundantDomain.py
./findRedundantDomain.py ./direct-list-with-redundant ./direct-list-deleted-unsort
./findRedundantDomain.py ./proxy-list-with-redundant ./proxy-list-deleted-unsort
2023-04-09 01:05:26 +08:00
# ./findRedundantDomain.py ./reject-list-with-redundant ./reject-list-deleted-unsort
2020-03-05 13:05:43 +08:00
[ ! -f "direct-list-deleted-unsort" ] && touch direct-list-deleted-unsort
[ ! -f "proxy-list-deleted-unsort" ] && touch proxy-list-deleted-unsort
2023-04-09 01:05:26 +08:00
# [ ! -f "reject-list-deleted-unsort" ] && touch reject-list-deleted-unsort
2020-03-02 01:05:01 +08:00
sort ./direct-list-deleted-unsort > ./direct-list-deleted-sort
sort ./proxy-list-deleted-unsort > ./proxy-list-deleted-sort
2023-04-09 01:05:26 +08:00
# sort ./reject-list-deleted-unsort > ./reject-list-deleted-sort
2020-03-10 10:57:50 +08:00
diff ./direct-list-deleted-sort ./direct-list-with-redundant | awk '/^>/{print $2}' > ./direct-list-without-redundant
diff ./proxy-list-deleted-sort ./proxy-list-with-redundant | awk '/^>/{print $2}' > ./proxy-list-without-redundant
2023-04-09 01:05:26 +08:00
# diff ./reject-list-deleted-sort ./reject-list-with-redundant | awk '/^>/{print $2}' > ./reject-list-without-redundant
2020-03-10 10:57:50 +08:00
2020-08-03 19:14:25 +08:00
- name : Remove domains from "need-to-remove" lists in "hidden" branch
2020-03-10 10:57:50 +08:00
run : |
2020-08-03 19:14:25 +08:00
diff ./direct-need-to-remove.txt ./direct-list-without-redundant | awk '/^>/{print $2}' > temp-cn.txt
diff ./proxy-need-to-remove.txt ./proxy-list-without-redundant | awk '/^>/{print $2}' > temp-geolocation-\!cn.txt
2023-04-09 01:05:26 +08:00
# diff ./reject-need-to-remove.txt ./reject-list-without-redundant | awk '/^>/{print $2}' > temp-category-ads-all.txt
2020-03-02 01:05:01 +08:00
2020-08-03 19:14:25 +08:00
- name : Remove domains end with ".cn" in "temp-geolocation-!cn.txt" and write lists to data directory
run : |
2023-05-20 15:10:06 +08:00
cat temp-cn.txt | grep -v google | grep -v "acg.rip" | sort --ignore-case -u | perl -ne '/^((?=^.{1,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})*)/ && print "$1\n"' > ./community/data/cn
2020-08-03 19:14:25 +08:00
cat temp-cn.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > direct-tld-list.txt
2020-10-27 09:04:23 +08:00
cat temp-geolocation-\!cn.txt | sort --ignore-case -u | perl -ne '/^((?=^.{1,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})*)/ && print "$1\n"' | perl -ne 'print if not /\.cn$/' > ./community/data/geolocation-\!cn
2020-08-03 19:14:25 +08:00
cat temp-geolocation-\!cn.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > proxy-tld-list.txt
2023-04-09 01:05:26 +08:00
# cat temp-category-ads-all.txt | sort --ignore-case -u | perl -ne '/^((?=^.{1,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})*)/ && print "$1\n"' > ./community/data/category-ads-all
# cat temp-category-ads-all.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > reject-tld-list.txt
2020-08-03 19:14:25 +08:00
2021-01-21 17:38:16 +08:00
- name : Add `full`, `regexp` and `keyword` type of rules back into "cn", "geolocation-!cn" and "category-ads-all" list
2019-12-15 18:14:44 +08:00
run : |
2020-10-27 09:04:23 +08:00
[ -f "direct-reserve.txt" ] && cat direct-reserve.txt >> ./community/data/cn
[ -f "proxy-reserve.txt" ] && cat proxy-reserve.txt >> ./community/data/geolocation-\!cn
2023-04-09 01:05:26 +08:00
# [ -f "reject-reserve.txt" ] && cat reject-reserve.txt >> ./community/data/category-ads-all
2020-10-27 09:04:23 +08:00
cp ./community/data/cn direct-list.txt
cp ./community/data/geolocation-\!cn proxy-list.txt
2023-04-09 01:05:26 +08:00
# cp ./community/data/category-ads-all reject-list.txt
# awk '{print "0.0.0.0 " $0}' reject-list.txt > hosts
2019-12-15 18:14:44 +08:00
2023-02-09 12:26:28 +08:00
- name : Create `google-cn`、`apple-cn`、`gfw` lists
2020-06-10 15:13:52 +08:00
run : |
2021-01-29 07:22:55 +08:00
curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > ./community/data/google-cn
curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > ./community/data/apple-cn
2021-04-21 17:19:21 +08:00
cat ./gfwlist2dnsmasq/temp-gfwlist.txt | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' >> ./community/data/gfw
2021-01-18 16:56:18 +08:00
curl -sSL $WIN_SPY | grep "0.0.0.0" | awk '{print $2}' > ./community/data/win-spy
curl -sSL $WIN_UPDATE | grep "0.0.0.0" | awk '{print $2}' > ./community/data/win-update
curl -sSL $WIN_EXTRA | grep "0.0.0.0" | awk '{print $2}' > ./community/data/win-extra
2020-06-10 15:13:52 +08:00
2023-04-06 16:36:11 +08:00
- name : merge 'ios_rule_script/SteamCN'
2023-03-21 15:19:30 +08:00
env :
SED : sed '/^\s*#/d' | sed 's/DOMAIN,//g' | sed 's/DOMAIN-SUFFIX,//g' | sed 's/DOMAIN-KEYWORD,/keyword:/g'
2023-03-25 21:34:23 +08:00
run : |
curl -sSL https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/SteamCN/SteamCN.list | ${{ env.SED }} > steamcn.txt
while read line; do grep -q "$line @cn" ./community/data/steam || sed -i "/$line/ s/$/ @cn/" ./community/data/steam; done < steamcn.txt
cat ./community/data/steam
- name : Add `meta` data
env :
2023-04-11 14:53:09 +08:00
SED : sed '/^\s*#/d' | sed 's/^PROCESS-NAME,//' | sed 's/DOMAIN,/full:/g' | sed 's/DOMAIN-SUFFIX,//g' | sed 's/DOMAIN-KEYWORD,/keyword:/g' | sed '/^\s*IP-CIDR/d'
2023-03-21 15:19:30 +08:00
run : |
curl -sSL https://raw.githubusercontent.com/xishang0128/rules/main/biliintl.list > ./community/data/biliintl
2023-04-04 17:04:40 +08:00
curl -sSL https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/OneDrive/OneDrive.list | ${{ env.SED }} > ./community/data/onedrive
2023-04-11 14:53:09 +08:00
echo "sharepoint.cn" >> ./community/data/onedrive
2023-03-29 16:01:20 +08:00
curl -sSL https://raw.githubusercontent.com/xishang0128/rules/main/sharepoint.list > ./community/data/sharepoint
2023-04-11 14:53:09 +08:00
curl -sSL https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/PrivateTracker/PrivateTracker.list | ${{ env.SED }} > ./community/data/tracker
curl -sSL https://gitea.com/XIU2/TrackersListCollection/raw/branch/master/all.txt | grep -i "\.[A-Z]" | grep -v tracker | sed 's/^.*\/\///g' | sed 's/:.*\/.*//g' >> ./community/data/tracker
2019-12-13 23:26:24 +08:00
- name : Build geosite.dat file
run : |
2020-10-27 09:04:23 +08:00
cd custom || exit 1
2023-05-27 17:38:27 +08:00
# echo sentry.io >> ../community/data/openai
2020-10-27 09:04:23 +08:00
go run ./ --datapath=../community/data
2019-12-13 23:26:24 +08:00
2023-04-10 05:52:33 +08:00
- name : Build geosite-lite.dat file
env :
NO_SKIP : true
2023-04-11 02:18:49 +08:00
SED : grep DOMAIN | grep -v "#" | sed 's/ - DOMAIN,/full:/g' | sed 's/ - DOMAIN-SUFFIX,//g' | sed 's/ - DOMAIN-KEYWORD,/keyword:/g'
2023-04-10 04:52:49 +08:00
run : |
2023-04-12 15:55:17 +08:00
cd community || exit 1
2023-04-10 04:54:18 +08:00
mkdir -p data-lite
2023-04-10 18:18:51 +08:00
curl -sSL https://raw.githubusercontent.com/xishang0128/rules/main/biliintl.list > ./data-lite/biliintl
2023-04-11 02:18:49 +08:00
curl -sSL https://github.com/v2fly/domain-list-community/raw/master/data/ehentai > ./data-lite/ehentai
2023-04-13 20:59:33 +08:00
curl -sSL https://github.com/v2fly/domain-list-community/raw/master/data/private > ./data-lite/private
2023-04-11 02:31:49 +08:00
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/AbemaTV/AbemaTV.yaml | ${{ env.SED }} > ./data-lite/abema
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Apple/Apple_Classical.yaml | ${{ env.SED }} > ./data-lite/apple
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/AppleMusic/AppleMusic.yaml | ${{ env.SED }} > ./data-lite/applemusic
2023-04-11 02:18:49 +08:00
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/BiliBili/BiliBili.yaml | ${{ env.SED }} > ./data-lite/bilibili
2023-04-11 02:31:49 +08:00
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Bahamut/Bahamut.yaml | ${{ env.SED }} > ./data-lite/bahamut
2023-04-11 20:57:39 +08:00
2023-05-20 15:10:06 +08:00
curl https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/China/China_Domain.yaml | grep - | sed "s/ - '+.//g" | sed "s/ - '/full:/g" | grep -v "#" | grep -v "acg.rip" | sed "s/'//g" > ./data-lite/cn
2023-04-11 02:18:49 +08:00
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Google/Google.yaml | ${{ env.SED }} > ./data-lite/google
2023-04-11 02:31:49 +08:00
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/GitHub/GitHub.yaml | ${{ env.SED }} > ./data-lite/github
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Microsoft/Microsoft.yaml | ${{ env.SED }} > ./data-lite/microsoft
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Netflix/Netflix.yaml | ${{ env.SED }} > ./data-lite/netflix
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/OpenAI/OpenAI.yaml | ${{ env.SED }} > ./data-lite/openai
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/OneDrive/OneDrive.yaml | ${{ env.SED }} > ./data-lite/onedrive
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Pixiv/Pixiv.yaml | ${{ env.SED }} > ./data-lite/pixiv
2023-04-12 03:22:24 +08:00
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/ProxyLite/ProxyLite.yaml | ${{ env.SED }} > ./data-lite/proxy
2023-04-12 03:37:49 +08:00
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Spotify/Spotify.yaml | ${{ env.SED }} > ./data-lite/spotify
2023-04-11 02:18:49 +08:00
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Telegram/Telegram.yaml | ${{ env.SED }} > ./data-lite/telegram
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Twitter/Twitter.yaml | ${{ env.SED }} > ./data-lite/twitter
2023-04-11 02:31:49 +08:00
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/TikTok/TikTok.yaml | ${{ env.SED }} > ./data-lite/tiktok
curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/YouTube/YouTube.yaml | ${{ env.SED }} > ./data-lite/youtube
2023-04-12 03:22:24 +08:00
echo include:google >> ./data-lite/proxy && echo include:github >> ./data-lite/proxy && echo include:netflix >> ./data-lite/proxy
2023-04-12 03:47:32 +08:00
echo ipleak.net >> ./data-lite/proxy && echo browserleaks.org >> ./data-lite/proxy
2023-05-27 18:19:34 +08:00
echo "full:o33249.ingest.sentry.io" >> ./data-lite/openai
2023-04-12 15:55:17 +08:00
go run ./ --datapath=./data-lite --outputname geosite-lite.dat
2023-04-10 04:52:49 +08:00
2023-04-11 02:18:49 +08:00
- name : Get geoip.dat relative files
run : |
wget -O geoip-lite.dat https://github.com/xishang0128/geoip/raw/release/geoip.dat
wget https://github.com/Loyalsoldier/geoip/raw/release/geoip.dat
2023-04-10 17:59:57 +08:00
- name : Build db file
2023-04-10 04:52:49 +08:00
env :
NO_SKIP : true
run : |
2023-04-10 17:59:57 +08:00
mkdir -p v2box
cd v2box || exit 1
wget https://github.com/xishang0128/meta-rules-dat/releases/download/v2box/v2box
chmod 755 v2box
2023-04-10 18:06:26 +08:00
./v2box migrate geosite -i ../custom/publish/geosite.dat -o ./geosite.db
2023-04-12 16:08:23 +08:00
./v2box migrate geosite -i ../community/geosite-lite.dat -o ./geosite-lite.db
2023-04-10 18:06:26 +08:00
./v2box migrate geoip -i ../geoip.dat -o ./geoip.db
2023-04-10 18:09:34 +08:00
./v2box migrate geoip -i ../geoip-lite.dat -o ./geoip-lite.db
2023-03-21 15:19:30 +08:00
- name : Move and zip files
2020-02-24 15:49:06 +08:00
run : |
2023-02-09 12:26:28 +08:00
mkdir -p ./publish/
2023-04-10 17:15:00 +08:00
wget https://raw.githubusercontent.com/xishang0128/geoip/release/Country.mmdb -O ./publish/country-lite.mmdb
2023-04-10 01:40:18 +08:00
wget https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country.mmdb -O ./publish/country.mmdb
2023-04-10 17:10:35 +08:00
install -Dp ./geoip-lite.dat ./publish/
2023-02-09 12:26:28 +08:00
install -Dp ./geoip.dat ./publish/
install -Dp ./custom/publish/geosite.dat ./publish/
2023-04-12 16:08:23 +08:00
install -Dp ./community/geosite-lite.dat ./publish/
2023-04-10 18:02:11 +08:00
install -Dp ./v2box/geosite.db ./publish/
install -Dp ./v2box/geosite-lite.db ./publish/
install -Dp ./v2box/geoip.db ./publish/
2023-04-10 18:09:34 +08:00
install -Dp ./v2box/geoip-lite.db ./publish/
2023-04-02 21:38:49 +08:00
curl -sSL https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/ChinaMax/ChinaMax_Domain.yaml | sed '/^\s*#/d' > ./publish/cn_domain.yaml
curl -sSL https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Proxy/Proxy_Domain.yaml | sed '/^\s*#/d' > ./publish/proxy.yaml
2023-04-21 01:59:27 +08:00
curl -sSL https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/ChinaMax/ChinaMax_Classical.yaml | grep DOMAIN | grep -v "#" | sed 's/ - DOMAIN,/full:/g' | sed 's/ - DOMAIN-SUFFIX,//g' | sed 's/ - DOMAIN-KEYWORD,/keyword:/g' > ./publish/cn.txt
2020-10-27 09:04:23 +08:00
cd ./publish || exit 1
2023-03-07 22:49:55 +08:00
2023-03-21 15:19:30 +08:00
- name : Delete current release assets
uses : andreaswilli/delete-release-assets-action@v2.0.0
with :
github_token : ${{ secrets.GITHUB_TOKEN }}
tag : latest
deleteOnlyFromDrafts : false
2020-03-01 13:04:29 +08:00
- name : Release and upload assets
2021-08-09 00:57:45 +08:00
uses : softprops/action-gh-release@v0.1.6
2020-02-28 02:36:52 +08:00
with :
2023-06-01 16:27:55 +08:00
name : Latest
tag_name : Latest
2020-02-28 02:36:52 +08:00
draft : false
prerelease : false
2020-03-01 13:04:29 +08:00
files : |
./publish/*
2020-02-28 02:36:52 +08:00
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2020-03-01 16:15:45 +08:00
- name : Git push assets to "release" branch
run : |
2021-01-21 17:38:16 +08:00
cd publish || exit 1
2020-03-01 16:15:45 +08:00
git init
2021-03-19 12:38:09 +08:00
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
2020-03-01 16:15:45 +08:00
git checkout -b release
git add .
git commit -m "${{ env.RELEASE_NAME }}"
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
2020-03-01 16:49:00 +08:00
git push -f -u origin release
2022-08-30 21:03:20 +08:00
- name : Purge jsdelivr CDN
run : |
cd publish || exit 1
for file in $(ls); do
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@release/${file}"
done