gitlink-cli/skills/gitlink-release/examples/release-workflow.md

92 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Release 管理工作流
## 场景:创建、查看、删除发布
### 步骤 1创建 Release
```bash
gitlink-cli release +create \
--owner wbtiger \
--repo gitlink-cli \
-t "v0.1.0-cli-test" \
-n "CLI Test Release v0.1.0" \
-b "## 更新内容
- 修复 Issue 创建 done_ratio 字段
- 修复 Issue 关闭 subject 字段
- 优化 branch +list 端点"
```
**返回**:
```json
{
"ok": true,
"data": {
"message": "发布成功",
"status": 0
}
}
```
### 步骤 2列出 Release
```bash
gitlink-cli release +list --owner wbtiger --repo gitlink-cli
```
**返回**:
```json
{
"ok": true,
"data": {
"releases": [
{
"name": "CLI Test Release v0.1.0",
"tag_name": "v0.1.0-cli-test",
"version_id": 1752,
"body": "## 更新内容...",
"created_at": "2026-04-01 21:32"
}
]
}
}
```
### 步骤 3查看 Release 详情
```bash
# ⚠️ 必须使用 version_id不能用 tag_name
gitlink-cli release +view --owner wbtiger --repo gitlink-cli -i 1752
```
### 步骤 4删除 Release
```bash
# ⚠️ 当前 GitLink API 有 Bug可能返回"版本不存在"
gitlink-cli release +delete --owner wbtiger --repo gitlink-cli -i 1752
```
## 测试验证
✅ 已验证的工作流2026-04-01:
- release +create: 成功
- release +list: 成功
- release +view: 成功(使用 version_id
❌ 已知问题:
- release +delete: API 返回"版本不存在"GitLink Bug
- release +view 用 tag_name: 返回 HTML 页面而非 JSON
## 常见错误
| 错误 | 原因 | 解决 |
|------|------|------|
| 返回 HTML 页面 | release +view 用了 tag_name | 使用 version_id 代替 |
| "版本不存在" | release +delete 调用 GitLink API Bug | 暂无解决方案 |
| 404 错误 | release 不存在 | 检查 version_id 是否正确 |
## 最佳实践
1. 总是先用 `release +list` 获取 version_id
2. 使用 version_id 而非 tag_name 进行查看操作
3. Release 删除功能暂不可用,建议通过 Web UI 删除