Compare commits
8 Commits
v20241003.
...
v20241003.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
555acef5c1 | ||
|
|
c6fdf656fd | ||
|
|
92a7e03482 | ||
|
|
2740c7a3ce | ||
|
|
a780ff9a2b | ||
|
|
9f2b1b5045 | ||
|
|
9ff1fa9969 | ||
|
|
ed194cb9d4 |
76
.github/workflows/auto-release.yml
vendored
76
.github/workflows/auto-release.yml
vendored
@@ -1,49 +1,59 @@
|
||||
name: Auto Generate Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'gfw.pac' # 替换为你要监控的文件路径
|
||||
- 'gfw.pac'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
generate-release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Git
|
||||
run: |
|
||||
git config --global user.name "GitHub Actions"
|
||||
git config --global user.email "actions@github.com"
|
||||
- name: Set up Git
|
||||
run: |
|
||||
git config --global user.name "GitHub Actions"
|
||||
git config --global user.email "actions@github.com"
|
||||
|
||||
- name: Get commit count for today
|
||||
id: commit_count
|
||||
run: |
|
||||
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$')
|
||||
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_ENV
|
||||
echo "RELEASE_NAME=v$(TZ='Asia/Shanghai' date +%Y%m%d).$commit_count" >> $GITHUB_ENV
|
||||
- name: Get commit count for today
|
||||
id: commit_count
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||
run: |
|
||||
today=$(date +%Y%m%d)
|
||||
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 "RELEASE_NAME=v$(TZ='Asia/Shanghai' date +%Y%m%d).$commit_count" >> $GITHUB_ENV
|
||||
|
||||
- name: Create Tag
|
||||
id: create_tag
|
||||
run: |
|
||||
git tag "${{ env.RELEASE_NAME }}"
|
||||
git push origin ${{ env.RELEASE_NAME }}
|
||||
- name: Create Tag
|
||||
id: create_tag
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||
run: |
|
||||
git tag "${{ env.RELEASE_NAME }}"
|
||||
git push origin ${{ env.RELEASE_NAME }}
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: "${{ env.RELEASE_NAME }}"
|
||||
name: "${{ env.RELEASE_NAME }}"
|
||||
body: "Automatically generated release for pac file update"
|
||||
draft: false
|
||||
prerelease: false
|
||||
files: gfw.pac # 替换为你要上传的文件路径
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: softprops/action-gh-release@v2
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||
with:
|
||||
tag_name: "${{ env.RELEASE_NAME }}"
|
||||
name: "${{ env.RELEASE_NAME }}"
|
||||
body: "Automatically generated release for pac file update"
|
||||
draft: false
|
||||
prerelease: false
|
||||
files: gfw.pac
|
||||
|
||||
- name: Verify Release
|
||||
run: |
|
||||
echo "Release created with name ${{ env.RELEASE_NAME }}"
|
||||
- name: Verify Release
|
||||
run: |
|
||||
echo "Release created with name ${{ env.RELEASE_NAME }}"
|
||||
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:
|
||||
schedule:
|
||||
- cron: '0 0 */14 * *'
|
||||
- cron: '0 0 */7 * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -10,15 +10,19 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||
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
|
||||
|
||||
- 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
|
||||
|
||||
- name: Commit gfw.pac
|
||||
- name: Commit changes
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
@@ -27,6 +31,8 @@ jobs:
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||
with:
|
||||
github_token: ${{ secrets.PUSH_TOKEN }}
|
||||
github_token: ${{ secrets.PERSONAL_TOKEN }}
|
||||
branch: master
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
科学上网 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地址段
|
||||
|
||||
1564
cidrs-cn.txt
1564
cidrs-cn.txt
File diff suppressed because it is too large
Load Diff
@@ -86,6 +86,7 @@ www.google-analytics.com
|
||||
pagead2.googlesyndication.com
|
||||
adservice.google.com
|
||||
fonts.googleapis.com
|
||||
safebrowsing.googleapis.com
|
||||
fonts.gstatic.com
|
||||
www.gstatic.com
|
||||
ssl.gstatic.com
|
||||
|
||||
Reference in New Issue
Block a user