Skip to content

Commit 81d3432

Browse files
committed
ci: 优化 AUR 工作流过滤规则并新增 Tag 自动发布 Release 工作流
- 为 aur-publish.yml 添加 paths-ignore,避免仅修改文档时触发 AUR 推送 - 新增 release-source.yml 工作流,在推送 v* 格式 Tag 时自动创建 Release 并附带变更日志链接
1 parent d6c036a commit 81d3432

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

‎.github/workflows/aur-publish.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
push:
55
branches:
66
- main
7+
paths-ignore:
8+
- '**.md'
9+
- 'docs/**'
10+
- 'LICENSE'
711
workflow_dispatch:
812

913
jobs:
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v4
16+
17+
- name: Generate Release Notes
18+
run: |
19+
TAG_VER="${{ github.ref_name }}"
20+
# Strip 'v' prefix if it exists (e.g., v4.9.15 -> 4.9.15)
21+
VER="${TAG_VER#v}"
22+
23+
# Try to find the matching changelog file (e.g., docs/changelog/*-to-4.9.15.md)
24+
CHANGELOG_FILE=$(find docs/changelog -name "*-to-${VER}.md" | head -n 1)
25+
26+
echo "适配上游 ${TAG_VER} 的版本。" > release_notes.md
27+
echo "" >> release_notes.md
28+
echo "⚠️ **说明**:本项目不分发重新打包的官方二进制安装包(以规避再分发的版权风险)。请在下方 **Assets** 列表中下载本项目对应标签版本的自动移植与安装构建脚本工具压缩包(\`Source code (zip)\` / \`Source code (tar.gz)\`),并解压至本地根据 README 指引执行构建与安装。" >> release_notes.md
29+
echo "" >> release_notes.md
30+
echo "详细变更记录与移植适配细节,请查阅项目中的:" >> release_notes.md
31+
32+
if [ -n "$CHANGELOG_FILE" ] && [ -f "$CHANGELOG_FILE" ]; then
33+
FILE_NAME=$(basename "$CHANGELOG_FILE")
34+
echo "👉 [${FILE_NAME} 详细变更记录](https://github.com/${{ github.repository }}/blob/main/docs/changelog/${FILE_NAME})" >> release_notes.md
35+
else
36+
echo "👉 [版本变更记录目录](https://github.com/${{ github.repository }}/blob/main/docs/changelog/)" >> release_notes.md
37+
fi
38+
39+
- name: Create GitHub Release
40+
env:
41+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
run: |
43+
gh release create "${{ github.ref_name }}" \
44+
--title "${{ github.ref_name }}" \
45+
--notes-file release_notes.md

0 commit comments

Comments
 (0)