Auto update #438
This file contains hidden or 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: 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@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v3 | |
with: | |
repository: JinnLynn/genpac | |
path: genpac | |
- uses: actions/checkout@v3 | |
with: | |
repository: gfwlist/gfwlist | |
path: gfwlist | |
- uses: leozhaozheng/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:1088; SOCKS 127.0.0.1:1088; DIRECT;" --gfwlist-url - --gfwlist-local gfwlist/gfwlist.txt -o gfwlist-socks-local.pac | |
sed '1,7d' -i gfwlist-socks-local.pac | |
genpac --pac-proxy "SOCKS5 192.168.31.114:1088; SOCKS 192.168.31.114:1088; DIRECT;" --gfwlist-url - --gfwlist-local gfwlist/gfwlist.txt -o gfwlist-socks-debian.pac | |
sed '1,7d' -i gfwlist-socks-debian.pac | |
genpac --pac-proxy "http 192.168.31.114:8080; http 192.168.31.114:8080; DIRECT;" --gfwlist-url - --gfwlist-local gfwlist/gfwlist.txt -o gfwlist-http-debian.pac | |
sed '1,7d' -i gfwlist-http-debian.pac | |
git add gfwlist-socks-local.pac gfwlist-socks-debian.pac gfwlist-http-debian.pac | |
git commit -m "[$(LANG=C date)] auto update" || exit 0 | |
[ -n "${{ secrets.READ_ONLY }}" ] && git show && exit 0 | |
git push origin master |