Update ip list #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update ip list | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 2 1,16 * *' | |
# watch: | |
# types: [started] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- name: Set up Python | |
uses: actions/setup-python@main | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install netaddr requests | |
- name: generate cn iplist | |
run: | |
python scripts/update_chnip.py | |
- name: generate rules | |
run: | | |
for script in ./scripts/generate/*.py; do | |
python "$script" & | |
done | |
- name: Commit file | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git add chnroute.txt | |
git add chnroute-ipv4.txt | |
git add chnroute-ipv6.txt | |
git add cn.rsc | |
git add ipv6.list | |
git add ./Loon/ruleset/ipv6.list | |
git add chn.acl | |
git add v2ray-config_rule.json | |
git add chnroute.pac | |
git commit -m "Update `date +%Y-%m-%d`" -a --author="${GITHUB_ACTOR} <${GITHUB_EMAIL}> github-actions[bot] <github-actions[bot]@users.noreply.github.com>" | |
git push -f origin master |