diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37e727b..f8f87c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,12 +29,12 @@ jobs: echo "::set-env name=APPLE_DOMAINS_URL::https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf" echo "::set-env name=GFWLIST_DOMAINS_URL::https://cokebar.github.io/gfwlist2dnsmasq/gfwlist_domain.txt" echo "::set-env name=GREATFIRE_DOMAINS_URL::https://raw.githubusercontent.com/wongsyrone/domain-block-list/master/domains.txt" + echo "::set-env name=PROFILES_URL::https://raw.githubusercontent.com/ConnersHua/Profiles/master/Shadow/Pro.conf" echo "::set-env name=GEQ1AN_RULES_APPLE_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/Apple.list" echo "::set-env name=GEQ1AN_RULES_MICROSOFT_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/Microsoft.list" echo "::set-env name=GEQ1AN_RULES_GLOBAL_MEDIA_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/GMedia.list" echo "::set-env name=GEQ1AN_RULES_OUTSIDE_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/Outside.list" echo "::set-env name=GEQ1AN_RULES_REJECT_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/AdBlock.list" - echo "::set-env name=PROFILES_REJECT_URL::https://raw.githubusercontent.com/ConnersHua/Profiles/master/Shadow/Pro.conf" echo "::set-env name=LHIE1_RULES_REJECT_URL::https://raw.githubusercontent.com/lhie1/Rules/master/Auto/REJECT.conf" echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)" echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin" @@ -73,6 +73,7 @@ jobs: curl -sSL $GREATFIRE_DOMAINS_URL >> temp-proxy.txt curl -sSL $GOOGLE_DOMAINS_URL | awk -F '/' '{print $2}' >> temp-proxy.txt curl -sSL $APPLE_DOMAINS_URL | awk -F '/' '{print $2}' >> temp-proxy.txt + curl -sSL $PROFILES_URL | awk -F ',' '/^DOMAIN(,|\-SUFFIX,).+PROXY/ {print $2}' >> temp-proxy.txt curl -sSL $GEQ1AN_RULES_APPLE_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+Apple/ {print $2}' >> temp-proxy.txt curl -sSL $GEQ1AN_RULES_MICROSOFT_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+Microsoft/ {print $2}' >> temp-proxy.txt curl -sSL $GEQ1AN_RULES_GLOBAL_MEDIA_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+GMedia/ {print $2}' >> temp-proxy.txt @@ -80,7 +81,7 @@ jobs: - name: Get and add reject domains into temp-reject.txt file run: | - curl -sSL $PROFILES_REJECT_URL | awk -F ',' '/^DOMAIN(,|\-SUFFIX,).+REJECT/ {print $2}' > temp-reject.txt + curl -sSL $PROFILES_URL | awk -F ',' '/^DOMAIN(,|\-SUFFIX,).+REJECT/ {print $2}' > temp-reject.txt curl -sSL $GEQ1AN_RULES_REJECT_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+AdBlock/ {print $2}' >> temp-reject.txt curl -sSL $LHIE1_RULES_REJECT_URL | awk -F ',' '/^DOMAIN(,|\-SUFFIX,).+REJECT/ {print $2}' >> temp-reject.txt @@ -89,11 +90,20 @@ jobs: cat proxy.txt >> temp-proxy.txt cat direct.txt >> temp-direct.txt - - name: Remove repeated domains and write domains to appropriate list + - name: Remove repeated domains, sort domains and write domains to appropriate list run: | - cat temp-proxy.txt | sort --ignore-case -u > $GOPATH/src/$GEOSITE_REPO/data/proxylist - cat temp-direct.txt | sort --ignore-case -u > $GOPATH/src/$GEOSITE_REPO/data/directlist - cat temp-reject.txt | sort --ignore-case -u > $GOPATH/src/$GEOSITE_REPO/data/rejectlist + cat temp-proxy.txt | sort --ignore-case -u > proxy-sort.txt + cat temp-direct.txt | sort --ignore-case -u > direct-sort.txt + cat temp-reject.txt | sort --ignore-case -u > reject-sort.txt + + - name: Filter valid domains + run: | + cat proxy-sort.txt | awk '/^([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]+$/{print $0}' > $GOPATH/src/$GEOSITE_REPO/data/proxylist + cat proxy-sort.txt | awk '!/^([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]+$/{print $0}' > proxy-filter.txt + cat direct-sort.txt | awk '/^([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]+$/{print $0}' > $GOPATH/src/$GEOSITE_REPO/data/directlist + cat direct-sort.txt | awk '!/^([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]+$/{print $0}' > direct-filter.txt + cat reject-sort.txt | awk '/^([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]+$/{print $0}' > $GOPATH/src/$GEOSITE_REPO/data/rejectlist + cat reject-sort.txt | awk '!/^([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]+$/{print $0}' > reject-filter.txt - name: Add list into appropriate category file run: | @@ -106,6 +116,7 @@ jobs: run: | domain-list-community mv ./dlc.dat ./publish/geosite.dat + mv ./*-filter.txt ./publish/ - name: Release dat files uses: Ricky-Hao/action-release@master