ci: use isolated self-hosted Windows Python runtime builds

This commit is contained in:
Tianyi Cui
2026-09-06 13:21:26 +08:00
parent 450d98b398
commit 69b1e315b4
9 changed files with 307 additions and 5 deletions
+2
View File
@@ -15,6 +15,8 @@ pnpm exec tsx scripts/build-exe-for-python-sdk.ts
所需 `lib/` 产物已存在时使用 `--skip-build`;如需选择平台,请使用 `--targets=node24-linux-x64,node24-linux-arm64,node24-macos-arm64,node24-macos-x64,node24-win-x64`。每个目标都应在其原生架构上构建。产物写入 `dist-exe/`,脚本会将所选载体同步到 `python/sdk-runtime/`。Windows 会生成 `.exe``-rg.exe`macOS 构建还会同步 `node-pty` 所需的配套 spawn 辅助程序。
仅用于 CI 的 Windows x64 构建可在 `DSH_CI_FAILOVER_WINDOWS=selfhosted` 时使用自托管池:只有同仓库、非 fork、非 Dependabot 的拉取请求以及向 `master` 的推送符合条件。作业将 Python 3.10 下载到私有临时目录而不在 Windows 中注册它,隔离构建缓存与测试环境,并在成功或失败后删除该目录。发布与手动构建、Linux 与 macOS 目标,以及 SDK wheel 辅助作业仍使用托管运行器。镜像前提与验证限制见[运行器隔离提案](../.agents/notes/proposed/process/2026-09-06-python-runtime-windows-selfhosted.zh.md)。
## 验证 SDK
请将虚拟环境放在 `python/` 之外,安装测试组,然后运行 Python 测试套件: