feat: 支持按 Tag 打包,分支管理可添加 Tag

- 分支管理新增「分支 / Tag」类型选择,Tag 存于 config["tags"],与分支不可重名
- 每个 Tag 与分支一样拥有同名独立版本轨道,默认上架轨
- 打包页按「分支」「Tag」分组选择;任务新增 ref_type 字段记录引用类型
- Tag 打包时 fetch --tags --force 后以游离 HEAD 检出 refs/tags/<tag>
- 历史记录与下载页按类型显示「分支」或「Tag」

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-17 11:59:18 +09:00
co-authored by Claude Opus 5
parent 6867a3cb01
commit 5582aadc09
18 changed files with 347 additions and 50 deletions
+7 -1
View File
@@ -1,7 +1,7 @@
"""打包选择 API"""
from fastapi import APIRouter
from .config import load_config
from .config import get_tags, load_config
router = APIRouter(prefix="/api", tags=["apps"])
@@ -44,3 +44,9 @@ async def get_branches_for_build():
"""获取分支列表(供打包选择)"""
config = load_config()
return config.get("branches", ["main"])
@router.get("/tags")
async def get_tags_for_build():
"""获取 Tag 列表(供打包选择)"""
return get_tags(load_config())