fix: 上传二维码并发送 Ad Hoc 通知

This commit is contained in:
shenlei
2026-07-20 15:22:44 +09:00
parent 8c0bce45a4
commit 9b77441ec7
6 changed files with 190 additions and 5 deletions
+6 -4
View File
@@ -58,7 +58,7 @@ def _write_download_page(config: dict, html: Path, manifest_url: str):
)
def _remote_paths(config: dict) -> tuple[str, str, str]:
def _remote_paths(config: dict) -> tuple[str, str, str, str]:
stem = _artifact_stem(config)
folder = config.get("OSS_FLODER", "ios-builds").strip("/") or "ios-builds"
root = posixpath.join(folder, "iOS")
@@ -66,6 +66,7 @@ def _remote_paths(config: dict) -> tuple[str, str, str]:
posixpath.join(root, f"{stem}.ipa"),
posixpath.join(root, f"{stem}.plist"),
posixpath.join(root, f"{stem}.html"),
posixpath.join(root, f"{stem}.png"),
)
@@ -127,7 +128,7 @@ def _upload_oss(config: dict, files: list[tuple[Path, str]]) -> dict[str, str]:
def publish_ipa(config: dict, ipa_path: Path, build_dir: Path) -> tuple[str, str]:
"""发布 IPA,返回下载 URL 与二维码本地路径"""
"""发布 IPA,返回下载 URL 与二维码公开 URL"""
upload = config.get("_upload_config", {})
mode = upload.get("mode", "")
if mode not in {"oss", "webdav"}:
@@ -135,7 +136,7 @@ def publish_ipa(config: dict, ipa_path: Path, build_dir: Path) -> tuple[str, str
output_dir = build_dir / "distribution"
ipa_file, manifest, html = _write_distribution_files(config, ipa_path, output_dir)
ipa_remote, manifest_remote, html_remote = _remote_paths(config)
ipa_remote, manifest_remote, html_remote, qr_remote = _remote_paths(config)
uploader = _upload_oss if mode == "oss" else _upload_webdav
@@ -157,4 +158,5 @@ def publish_ipa(config: dict, ipa_path: Path, build_dir: Path) -> tuple[str, str
except ImportError as exc:
raise DistributionError("未安装 qrcode,请重新执行 ./deploy.sh build") from exc
qrcode.make(urls[".html"]).save(qr_path)
return urls[".html"], str(qr_path)
urls.update(uploader(upload, [(qr_path, qr_remote)]))
return urls[".html"], urls[".png"]