-
Notifications
You must be signed in to change notification settings - Fork 168
51 lines (43 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
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@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install netaddr requests
- name: generate cn iplist
run: |
wget 'https://raw.githubusercontent.com/PaPerseller/chn-iplist/master/scripts/update_chnip.py'
python update_chnip.py
- name: generate rules
run: |
wget 'https://raw.githubusercontent.com/PaPerseller/chn-iplist/master/scripts/generate.py'
python generate.py
rm update_chnip.py generate.py
- 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 commit -m "AutoUpdate `date +%Y-%m-%d`" -a
git push -f origin master