fix: 通用项目以 App 字段作为产物文件名和通知中的 App 标识

通用项目(如朵云轩)没有 AppGuid,通知中 App Guid 为空、产物文件名以 _ 开头。
改为取第一个 App 字段(如 APPID)作为 App 标识,并在通知中显示该字段名;
未填写时回退到 upload_key。Readoor 项目不变。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-23 11:02:28 +09:00
co-authored by Claude Opus 5.5
parent 6890f13aa9
commit 9c0b677d38
4 changed files with 56 additions and 4 deletions
+8 -1
View File
@@ -20,7 +20,7 @@ from ..config import (
get_git_remote_url,
mask_git_remote_url,
)
from ..projects import LEGACY_PROJECT_ID, get_definition, get_project_source
from ..projects import LEGACY_PROJECT_ID, PATCHER_READOOR, get_definition, get_project_source
from .log_streamer import log_streamer
from .distribution import DistributionError, publish_dsym, publish_ipa
from .notification import NotificationError, send_dingtalk_notification
@@ -808,6 +808,13 @@ async def generate_config(task_id: str, task, build_dir: Path) -> dict:
config_data["APP_VARS"] = {
field["key"]: app.get(field["key"], "") for field in definition["app_fields"] if field.get("key")
}
# 通用项目没有 AppGuid:以第一个 App 字段(如 APPID)作为 App 标识,
# 用于产物文件名和通知;未配置 App 字段时用 upload_key。
if definition["patcher"] != PATCHER_READOOR:
id_field = next((field for field in definition["app_fields"] if field.get("key")), None)
app_ident = config_data["APP_VARS"].get(id_field["key"], "") if id_field else ""
config_data["APPID"] = app_ident or config_data["UPLOAD_KEY"]
config_data["APPID_LABEL"] = (id_field.get("label") or id_field["key"]) if app_ident else "App 标识"
config_data["SERVER_VARS"] = {
field["key"]: server.get(field["key"], "") for field in definition["server_fields"] if field.get("key")
}
+1 -1
View File
@@ -59,7 +59,7 @@ def build_dingtalk_payload(
f"**版本:** {config_data.get('VERSION', '')}\n\n"
f"**APP名称:** {config_data.get('APPID_NAME', '')}\n\n"
f"**包名:** {config_data.get('BUNDLE_ID', '')}\n\n"
f"**App Guid:** {config_data.get('APPID', '')}"
f"**{config_data.get('APPID_LABEL', 'App Guid')}:** {config_data.get('APPID', '')}"
)
text = f"## {heading}\n\n{details}\n\n**iOS 下载链接:** {download_url}\n"
if qr_code_url: