File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - main
7+ paths-ignore :
8+ - ' **.md'
9+ - ' docs/**'
10+ - ' LICENSE'
711 workflow_dispatch :
812
913jobs :
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments