-
Notifications
You must be signed in to change notification settings - Fork 417
53 lines (40 loc) · 1.29 KB
/
update.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
53
name: Auto update
on:
schedule:
- cron: '37 19 * * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Install packages
run: |
sudo apt-get install openssh-client python3-setuptools
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
with:
repository: JinnLynn/genpac
ref: v2.0.1
path: genpac
- uses: actions/checkout@v4
with:
repository: gfwlist/gfwlist
path: gfwlist
- uses: petronny/git-config-user@master
with:
path: .
- run: |
cd genpac
sed 's/from collections import Callable/from collections.abc import Callable/g' -i $(grep 'from collections import Callable' . -rIl)
sudo python3 setup.py install
- name: Update
run: |
set -x
genpac --pac-proxy "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT;" --gfwlist-url - --gfwlist-local gfwlist/gfwlist.txt -o gfwlist.pac
sed '1,7d' -i gfwlist.pac
git add gfwlist.pac
git commit -m "[$(LANG=C date)] auto update" || exit 0
[ -n "${{ secrets.READ_ONLY }}" ] && git show && exit 0
git push origin master