Skip to content

Commit 5b502c2

Browse files
author
User
committed
feat: Release 自动生成更新说明
- 自动获取自上次 tag 以来的 commit 信息 - 美化 Release 页面格式 - 添加下载说明表格
1 parent 90835c7 commit 5b502c2

File tree

1 file changed

+42
-7
lines changed

1 file changed

+42
-7
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,33 @@ jobs:
2323
steps:
2424
- name: Checkout repository
2525
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0 # Fetch all history for changelog
28+
29+
- name: Get commit messages since last tag
30+
id: changelog
31+
run: |
32+
# Get the last tag
33+
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
34+
35+
if [ -z "$LAST_TAG" ]; then
36+
# No previous tag, get all commits
37+
COMMITS=$(git log --pretty=format:"- %s" -20)
38+
else
39+
# Get commits since last tag
40+
COMMITS=$(git log ${LAST_TAG}..HEAD --pretty=format:"- %s")
41+
fi
42+
43+
# Handle empty commits
44+
if [ -z "$COMMITS" ]; then
45+
COMMITS="- Initial release"
46+
fi
47+
48+
# Save to output (handle multiline)
49+
echo "commits<<EOF" >> $GITHUB_OUTPUT
50+
echo "$COMMITS" >> $GITHUB_OUTPUT
51+
echo "EOF" >> $GITHUB_OUTPUT
52+
shell: bash
2653

2754
- name: Setup Node.js
2855
uses: actions/setup-node@v4
@@ -61,18 +88,26 @@ jobs:
6188
tagName: v${{ github.run_number }}
6289
releaseName: 'LoArchive v${{ github.run_number }}'
6390
releaseBody: |
64-
## 更新内容
91+
## 🚀 LoArchive v${{ github.run_number }}
92+
93+
### 📝 更新内容
94+
${{ steps.changelog.outputs.commits }}
6595
66-
提交: ${{ github.sha }}
96+
---
6797
68-
### 下载说明
69-
- **Windows**: 下载 `.msi` 或 `.exe` 安装包
98+
### 📥 下载说明
99+
| 文件 | 说明 |
100+
|------|------|
101+
| `.msi` | Windows 安装包(推荐) |
102+
| `.exe` | Windows 便携版 |
70103
71-
### 使用方法
104+
### 🔧 使用方法
72105
1. 下载并安装
73106
2. 打开应用
74-
3. 在设置中配置 Lofter 登录信息
107+
3. 在「设置」中配置 Lofter 登录信息
75108
4. 开始使用!
109+
110+
---
111+
<sub>构建时间: ${{ github.event.head_commit.timestamp }}</sub>
76112
releaseDraft: false
77113
prerelease: false
78-

0 commit comments

Comments
 (0)