Compare commits
6 Commits
v20241003.
...
v20241003.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92a7e03482 | ||
|
|
2740c7a3ce | ||
|
|
a780ff9a2b | ||
|
|
9f2b1b5045 | ||
|
|
9ff1fa9969 | ||
|
|
ed194cb9d4 |
20
.github/workflows/auto-release.yml
vendored
20
.github/workflows/auto-release.yml
vendored
@@ -1,10 +1,10 @@
|
|||||||
name: Auto Generate Release
|
name: Auto Generate Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- 'gfw.pac' # 替换为你要监控的文件路径
|
- 'gfw.pac'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
generate-release:
|
generate-release:
|
||||||
@@ -12,7 +12,11 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Git
|
- name: Set up Git
|
||||||
run: |
|
run: |
|
||||||
@@ -21,14 +25,18 @@ jobs:
|
|||||||
|
|
||||||
- name: Get commit count for today
|
- name: Get commit count for today
|
||||||
id: commit_count
|
id: commit_count
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
today=$(date +%Y%m%d)
|
today=$(date +%Y%m%d)
|
||||||
commit_count=$(git log --since="$today 00:00:00" --until="$today 23:59:59" --pretty=format: --name-only | grep -c '^gfw.pac$')
|
commit_count=$(TZ=Asia/Shanghai git log --date=local --since="$today 00:00:00" --until="$today 23:59:59" --pretty=format: --name-only | grep -c '^gfw.pac$')
|
||||||
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_ENV
|
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_ENV
|
||||||
echo "RELEASE_NAME=v$(TZ='Asia/Shanghai' date +%Y%m%d).$commit_count" >> $GITHUB_ENV
|
echo "RELEASE_NAME=v$(TZ='Asia/Shanghai' date +%Y%m%d).$commit_count" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Create Tag
|
- name: Create Tag
|
||||||
id: create_tag
|
id: create_tag
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
git tag "${{ env.RELEASE_NAME }}"
|
git tag "${{ env.RELEASE_NAME }}"
|
||||||
git push origin ${{ env.RELEASE_NAME }}
|
git push origin ${{ env.RELEASE_NAME }}
|
||||||
@@ -36,13 +44,15 @@ jobs:
|
|||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: "${{ env.RELEASE_NAME }}"
|
tag_name: "${{ env.RELEASE_NAME }}"
|
||||||
name: "${{ env.RELEASE_NAME }}"
|
name: "${{ env.RELEASE_NAME }}"
|
||||||
body: "Automatically generated release for pac file update"
|
body: "Automatically generated release for pac file update"
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
files: gfw.pac # 替换为你要上传的文件路径
|
files: gfw.pac
|
||||||
|
|
||||||
- name: Verify Release
|
- name: Verify Release
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
14
.github/workflows/auto-update-gfw-pac.yml
vendored
14
.github/workflows/auto-update-gfw-pac.yml
vendored
@@ -2,7 +2,7 @@ name: GFW PAC Update
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 */14 * *'
|
- cron: '0 0 */7 * *'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -10,15 +10,19 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Download delegated-apnic-latest
|
- name: Download cn.txt
|
||||||
run: curl https://raw.githubusercontent.com/Loyalsoldier/geoip/refs/heads/release/text/cn.txt -o cidrs-cn.txt
|
run: curl https://raw.githubusercontent.com/Loyalsoldier/geoip/refs/heads/release/text/cn.txt -o cidrs-cn.txt
|
||||||
|
|
||||||
- name: Run gfw-pac.py script
|
- name: Run gfw-pac.py script
|
||||||
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 gfw.pac
|
- name: Commit changes
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "action@github.com"
|
git config --local user.email "action@github.com"
|
||||||
git config --local user.name "GitHub Action"
|
git config --local user.name "GitHub Action"
|
||||||
@@ -27,6 +31,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Push changes
|
- name: Push changes
|
||||||
uses: ad-m/github-push-action@master
|
uses: ad-m/github-push-action@master
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.PUSH_TOKEN }}
|
github_token: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
branch: master
|
branch: master
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
科学上网 PAC 文件以及生成器。通过自定义域名和 CNIP 地址生成 PAC(Proxy auto-config) 文件。对存在于自定义域名和解析出的IP不是CNIP的域名使用代理,支持IPv6。
|
科学上网 PAC 文件以及生成器。通过自定义域名和 CNIP 地址生成 PAC(Proxy auto-config) 文件。对存在于自定义域名和解析出的IP不是CNIP的域名使用代理,支持IPv6。
|
||||||
|
|
||||||
**此仓库每 14 天自动通过 GitHub Action 从 `Loyalsoldier/geoip` 获取国内地址段并更新 `gfw.pac` 文件**
|
**此仓库每 7 天自动通过 GitHub Action 从 `Loyalsoldier/geoip` 获取国内地址段并更新 `gfw.pac` 文件**
|
||||||
|
|
||||||
## 特性
|
## 特性
|
||||||
* 开箱即用,直接可用的 `gfw.pac` 包含了常用的直连域名和代理域名以及国内IPv4/IPv6地址段
|
* 开箱即用,直接可用的 `gfw.pac` 包含了常用的直连域名和代理域名以及国内IPv4/IPv6地址段
|
||||||
|
|||||||
1564
cidrs-cn.txt
1564
cidrs-cn.txt
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user