Compare commits

..

2 Commits

Author SHA1 Message Date
loyalsoldier
f5068de75f Generate cncidr.txt from @17mon/china_ip_list 2020-08-01 09:30:36 +08:00
loyalsoldier
4bb65003e6 Add GitHub workflow 2020-08-01 09:29:48 +08:00

View File

@@ -1,4 +1,4 @@
name: Generate rules for Clash Premium
name: Generate RULE-SET for Premium Edition of Clash
on:
schedule:
- cron: "30 22 * * *"
@@ -17,7 +17,7 @@ jobs:
echo "::set-env name=RELEASE_NAME::Released on $(date +%Y%m%d%H%M)"
echo "::set-env name=TAG_NAME::$(date +%Y%m%d%H%M)"
echo "::set-env name=v2fly_reject::https://raw.githubusercontent.com/v2fly/domain-list-community/release/category-ads-all.txt"
echo "::set-env name=v2fly_!cn::https://raw.githubusercontent.com/v2fly/domain-list-community/release/geolocation-!cn.txt"
echo "::set-env name=v2fly_not_cn::https://raw.githubusercontent.com/v2fly/domain-list-community/release/geolocation-!cn.txt"
echo "::set-env name=v2fly_cn::https://raw.githubusercontent.com/v2fly/domain-list-community/release/cn.txt"
echo "::set-env name=v2fly_icloud::https://raw.githubusercontent.com/v2fly/domain-list-community/release/icloud.txt"
echo "::set-env name=v2fly_apple::https://raw.githubusercontent.com/v2fly/domain-list-community/release/apple.txt"
@@ -26,6 +26,7 @@ jobs:
echo "::set-env name=Loyalsoldier_direct::https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/direct-list.txt"
echo "::set-env name=felixonmars_apple::https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf"
echo "::set-env name=felixonmars_google::https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf"
echo "::set-env name=ipipnet_chinaiplist::https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt"
shell: bash
- name: Checkout the "hidden" branch
@@ -36,32 +37,32 @@ jobs:
- name: Generate icloud.txt file
run: |
echo "payload:" > icloud.txt
curl -sSL $v2fly_icloud | grep -e "^full:" -e "^domain:" | awk -F ':' '{printf " - |+.%s|\n", $2}' | sed "s/|/'/g" >> icloud.txt
curl -sSL ${v2fly_icloud} | grep -e "^full:" -e "^domain:" | awk -F ':' '{printf " - |+.%s|\n", $2}' | sed "s/|/'/g" >> icloud.txt
- name: Generate google.txt file
run: |
echo "payload:" > google.txt
curl -sSL $felixonmars_google | awk -F '/' '{printf " - |+.%s|\n", $2}' | sed "s/|/'/g" >> google.txt
curl -sSL ${felixonmars_google} | awk -F '/' '{printf " - |+.%s|\n", $2}' | sed "s/|/'/g" >> google.txt
- name: Get and add apple domains into apple.temp file
run: |
curl -sSL $felixonmars_apple | awk -F '/' '{print $2}' > apple.temp
curl -sSL $v2fly_apple | grep -e "^full:" -e "^domain:" | awk -F ':' '{print $2}' >> apple.temp
curl -sSL ${felixonmars_apple} | awk -F '/' '{print $2}' > apple.temp
curl -sSL ${v2fly_apple} | grep -e "^full:" -e "^domain:" | awk -F ':' '{print $2}' >> apple.temp
- name: Get and add direct domains into direct.temp file
run: |
curl -sSL $Loyalsoldier_direct | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)+)\n/ && print "$1\n"' > direct.temp
curl -sSL $v2fly_cn | grep -e "^full:" -e "^domain:" | awk -F ':' '{print $2}' >> direct.temp
curl -sSL ${Loyalsoldier_direct} | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)+)\n/ && print "$1\n"' > direct.temp
curl -sSL ${v2fly_cn} | grep -e "^full:" -e "^domain:" | awk -F ':' '{print $2}' >> direct.temp
- name: Get and add proxy domains into proxy.temp file
run: |
curl -sSL $Loyalsoldier_proxy | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)+)\n/ && print "$1\n"' > proxy.temp
curl -sSL $v2fly_!cn | grep -e "^full:" -e "^domain:" | perl -ne 'print if not /(.+\.cn$)/' >> proxy.temp
curl -sSL ${Loyalsoldier_proxy} | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)+)\n/ && print "$1\n"' > proxy.temp
curl -sSL ${v2fly_not_cn} | grep -e "^full:" -e "^domain:" | awk -F ':' '{print $2}' | perl -ne 'print if not /(.+\.cn$)/' >> proxy.temp
- name: Get and add reject domains into reject.temp file
run: |
curl -sSL $Loyalsoldier_reject | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)+)\n/ && print "$1\n"' > reject.temp
curl -sSL $v2fly_reject | grep -e "^full:" -e "^domain:" | awk -F ':' '{print $2}' >> reject.temp
curl -sSL ${Loyalsoldier_reject} | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)+)\n/ && print "$1\n"' > reject.temp
curl -sSL ${v2fly_reject} | grep -e "^full:" -e "^domain:" | awk -F ':' '{print $2}' >> reject.temp
- name: Sort and generate redundant lists
run: |
@@ -101,10 +102,15 @@ jobs:
cat proxy-list-without-redundant | awk '{printf " - |+.%s|\n", $1}' | sed "s/|/'/g" >> proxy.txt
cat reject-list-without-redundant | awk '{printf " - |+.%s|\n", $1}' | sed "s/|/'/g" >> reject.txt
- name: Generate cncidr.txt file
run: |
echo "payload:" > cncidr.txt
curl -sSL ${ipipnet_chinaiplist} | perl -ne '/^(\d{1,3}(\.\d{1,3}){3}\/\d{1,2})/ && print " - |$1|\n"' | sed "s/|/'/g" >> cncidr.txt
- name: Move files to publish directory
run: |
mkdir -p publish
install -p {apple,icloud,google,proxy,direct,reject}.txt ./publish/
install -p {apple,icloud,google,proxy,direct,reject,cncidr,lancidr}.txt ./publish/
- name: Release and upload assets
uses: softprops/action-gh-release@v1