改改workflow
This commit is contained in:
74
.github/workflows/auto-release.yml
vendored
74
.github/workflows/auto-release.yml
vendored
@@ -11,43 +11,47 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
- env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Set up Git
|
||||||
uses: actions/checkout@v3
|
run: |
|
||||||
|
git config --global user.name "GitHub Actions"
|
||||||
|
git config --global user.email "actions@github.com"
|
||||||
|
|
||||||
- name: Set up Git
|
- name: Get commit count for today
|
||||||
run: |
|
id: commit_count
|
||||||
git config --global user.name "GitHub Actions"
|
env:
|
||||||
git config --global user.email "actions@github.com"
|
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
|
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
|
- name: Create Tag
|
||||||
id: commit_count
|
id: create_tag
|
||||||
run: |
|
env:
|
||||||
today=$(date +%Y%m%d)
|
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
commit_count=$(git log --since="$today 00:00:00" --until="$today 23:59:59" --pretty=format: --name-only | grep -c '^gfw.pac$')
|
run: |
|
||||||
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_ENV
|
git tag "${{ env.RELEASE_NAME }}"
|
||||||
echo "RELEASE_NAME=v$(TZ='Asia/Shanghai' date +%Y%m%d).$commit_count" >> $GITHUB_ENV
|
git push origin ${{ env.RELEASE_NAME }}
|
||||||
|
|
||||||
- name: Create Tag
|
- name: Create Release
|
||||||
id: create_tag
|
id: create_release
|
||||||
run: |
|
uses: softprops/action-gh-release@v2
|
||||||
git tag "${{ env.RELEASE_NAME }}"
|
env:
|
||||||
git push origin ${{ env.RELEASE_NAME }}
|
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: Create Release
|
- name: Verify Release
|
||||||
id: create_release
|
run: |
|
||||||
uses: softprops/action-gh-release@v2
|
echo "Release created with name ${{ env.RELEASE_NAME }}"
|
||||||
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 }}"
|
|
||||||
9
.github/workflows/auto-update-gfw-pac.yml
vendored
9
.github/workflows/auto-update-gfw-pac.yml
vendored
@@ -9,10 +9,9 @@ jobs:
|
|||||||
update-gfw-pac:
|
update-gfw-pac:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- env:
|
|
||||||
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Download cn.txt
|
- name: Download cn.txt
|
||||||
@@ -22,6 +21,8 @@ jobs:
|
|||||||
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 changes
|
- 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"
|
||||||
@@ -30,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.PERSONAL_TOKEN }}
|
github_token: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
branch: master
|
branch: master
|
||||||
|
|||||||
Reference in New Issue
Block a user