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:
@@ -55,6 +55,10 @@ async def create_task(task: TaskCreate, request: Request, user: dict = Depends(g
|
||||
detail=f"该 App 只能使用 Scheme: {', '.join(allowed_scheme_names)}",
|
||||
)
|
||||
|
||||
# 分支与 Tag 不允许重名,按名字即可确定要检出的引用类型
|
||||
from .config import get_ref_type
|
||||
ref_type = get_ref_type(config, task.branch)
|
||||
|
||||
task_id = str(uuid.uuid4())
|
||||
db_task = Task(
|
||||
id=task_id,
|
||||
@@ -65,12 +69,13 @@ async def create_task(task: TaskCreate, request: Request, user: dict = Depends(g
|
||||
scheme_name=scheme.get("displayName") or scheme_name,
|
||||
obfuscation=task.obfuscation,
|
||||
branch=task.branch,
|
||||
ref_type=ref_type,
|
||||
status="pending",
|
||||
)
|
||||
db.add(db_task)
|
||||
from ..services.audit_log import record_operation
|
||||
record_operation(db, user, "build_created", request=request, task=db_task,
|
||||
detail={"branch": task.branch, "build_type": task.build_type})
|
||||
detail={"branch": task.branch, "ref_type": ref_type, "build_type": task.build_type})
|
||||
db.commit()
|
||||
db.refresh(db_task)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user