mirror of https://github.com/dler-io/Rules.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
956 B
YAML
29 lines
956 B
YAML
name: Auto Update China IPs
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 0 * * *'
|
|
|
|
jobs:
|
|
update:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Update IPs
|
|
run: |
|
|
wget -c http://ftp.apnic.net/stats/apnic/delegated-apnic-latest
|
|
cat delegated-apnic-latest | awk -F '|' '/CN/&&/ipv4/ {print $4 "/" 32-log($5)/log(2)}' > raw_ips.txt
|
|
echo "# > Domestic IPs" > Surge/Surge 3/Provider/Domestic IPs.list
|
|
echo "payload:" > Clash/Provider/Domestic IPs.yaml
|
|
cat raw_ips.txt | awk '{print "IP-CIDR,"$1",no-resolve"}' >> Surge/Surge 3/Provider/Domestic IPs.list
|
|
cat raw_ips.txt | awk '{print " - "$1}' >> Clash/Provider/Domestic IPs.yaml
|
|
|
|
- name: Commit and push
|
|
run: |
|
|
git config --global user.email "actions@github.com"
|
|
git config --global user.name "GitHub Action"
|
|
git add .
|
|
git commit -m "Update China IPs"
|
|
git push |