Compare commits

...

4 Commits

3 changed files with 584 additions and 1262 deletions

View File

@@ -11,7 +11,6 @@ on:
- 'direct-domains.txt' - 'direct-domains.txt'
- 'proxy-domains.txt' - 'proxy-domains.txt'
- 'cidrs-cn.txt' - 'cidrs-cn.txt'
- '!gfw.pac'
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -21,13 +20,25 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Check if gfw.pac is in the commit
id: check-file
run: |
if git diff --name-only HEAD^ HEAD | grep -q 'gfw\.pac'; then
echo "file-exists=true" >> $GITHUB_ENV
else
echo "file-exists=false" >> $GITHUB_ENV
fi
- name: Download the latest cn.txt - name: Download the latest cn.txt
if: env.file-exists == 'false'
run: curl -L https://raw.githubusercontent.com/Loyalsoldier/geoip/release/text/cn.txt -o cidrs-cn.txt run: curl -L https://raw.githubusercontent.com/Loyalsoldier/geoip/release/text/cn.txt -o cidrs-cn.txt
- name: Run gfw-pac.py script - name: Run gfw-pac.py script
if: env.file-exists == 'false'
run: ./gfw-pac.py -f gfw.pac -p "PROXY 127.0.0.1:3128" --proxy-domains=proxy-domains.txt --direct-domains=direct-domains.txt --localtld-domains=local-tlds.txt --ip-file=cidrs-cn.txt run: ./gfw-pac.py -f gfw.pac -p "PROXY 127.0.0.1:3128" --proxy-domains=proxy-domains.txt --direct-domains=direct-domains.txt --localtld-domains=local-tlds.txt --ip-file=cidrs-cn.txt
- name: Commit and push changes - name: Commit and push changes
if: env.file-exists == 'false'
run: | run: |
last_commit_message=$(git log -1 --pretty=%B) last_commit_message=$(git log -1 --pretty=%B)
commit_message=$([[ "${{ github.event_name }}" == "schedule" ]] && echo "定期更新数据并生成 gfw.pac" || echo "自动生成 gfw.pac: $last_commit_message") commit_message=$([[ "${{ github.event_name }}" == "schedule" ]] && echo "定期更新数据并生成 gfw.pac" || echo "自动生成 gfw.pac: $last_commit_message")
@@ -38,6 +49,7 @@ jobs:
git push git push
- name: Trigger Auto-Release - name: Trigger Auto-Release
if: env.file-exists == 'false'
uses: benc-uk/workflow-dispatch@v1 uses: benc-uk/workflow-dispatch@v1
with: with:
workflow: Auto Generate Release workflow: Auto Generate Release

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because one or more lines are too long