-
Notifications
You must be signed in to change notification settings - Fork 169
52 lines (44 loc) · 1.36 KB
/
update-cnip.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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.12'
check-latest: true
- 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