42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
name: Auto Generate Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
paths:
|
|
- 'gfw.pac' # 替换为你要监控的文件路径
|
|
|
|
jobs:
|
|
generate-release:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- 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 "::set-output name=commit_count::${commit_count}"
|
|
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: v$(date +%Y%m%d).${{ steps.commit_count.outputs.commit_count }}
|
|
release_name: $(date +%Y%m%d).${{ steps.commit_count.outputs.commit_count }}
|
|
body: "Automatically generated release for file update"
|
|
draft: false
|
|
prerelease: false
|
|
files: gfw.pac # 替换为你要上传的文件路径
|
|
|
|
- name: Verify Release
|
|
run: |
|
|
echo "Release created with tag: v$(date +%Y%m%d).${{ steps.commit_count.outputs.commit_count }}" |