build-exe-for-python-sdk.yml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. name: Build single-exe
  2. # Native builds for the release targets; see
  3. # .agents/notes/implemented/architecture/2026-07-10-single-file-executable-sdk-runtime-distribution.md.
  4. # A full target run retains one SDK wheel and five runtime wheels; subset
  5. # dispatch retains the SDK wheel and selected runtime wheels. Bare executables
  6. # and source closures are test inputs. Run manually or call it from the Python
  7. # release workflow. There is no `pull_request` trigger: a label trigger would
  8. # list gray skipped checks on every unrelated PR label event. Checkout uses the
  9. # triggering ref, so dispatch needs no separate ref input.
  10. on:
  11. workflow_call:
  12. inputs:
  13. targets:
  14. description: Comma-separated pkg targets to build; empty builds all five.
  15. type: string
  16. required: false
  17. default: ''
  18. release:
  19. description: Run as the native builder for the Python release workflow.
  20. type: boolean
  21. required: false
  22. default: false
  23. ci:
  24. description: Run Python runtime CI validation for the selected targets.
  25. type: boolean
  26. required: false
  27. default: false
  28. secrets:
  29. DEEPSEEK_API_KEY_EXTERNAL:
  30. description: Real DeepSeek API key for trusted installed-wheel pull-request tests.
  31. required: false
  32. workflow_dispatch:
  33. inputs:
  34. targets:
  35. description: >-
  36. Comma-separated pkg targets to build. Any subset of:
  37. node24-linux-x64, node24-linux-arm64, node24-macos-arm64,
  38. node24-macos-x64, node24-win-x64. Empty builds all five.
  39. type: string
  40. required: false
  41. default: ''
  42. concurrency:
  43. # Keep the called workflow distinct from its caller's concurrency group;
  44. # github.workflow identifies the caller inside a reusable workflow and keeps
  45. # an ordinary CI run from cancelling a full release validation on the same ref.
  46. group: build-single-exe-${{ github.workflow }}-${{ github.ref }}
  47. # Release-owned builds are part of an intentional publication transaction.
  48. cancel-in-progress: ${{ !inputs.release }}
  49. permissions:
  50. contents: read
  51. env:
  52. # CI runs must never report to the production telemetry endpoint baked
  53. # into apps/cli/cordis.yml (AppCLIEntry disables the row when set).
  54. DSH_TELEMETRY_DISABLED: '1'
  55. jobs:
  56. # Job-level conditions cannot inspect `matrix`, so validate target names and
  57. # construct the matrix before the dependent jobs.
  58. plan:
  59. name: plan targets
  60. if: inputs.ci || inputs.release || github.event_name == 'workflow_dispatch'
  61. runs-on: ubuntu-latest
  62. timeout-minutes: 5
  63. outputs:
  64. matrix: ${{ steps.plan.outputs.matrix }}
  65. version: ${{ steps.version.outputs.version }}
  66. repository-version: ${{ steps.version.outputs.repository-version }}
  67. steps:
  68. - uses: actions/checkout@v6
  69. - name: Resolve repository version
  70. id: version
  71. run: |
  72. set -euo pipefail
  73. python3 - <<'PY' >> "$GITHUB_OUTPUT"
  74. import runpy
  75. release = runpy.run_path("scripts/build-python-release.py")
  76. repository_version = release["repository_version"]()
  77. wheel_version = release["pep440_version"](repository_version)
  78. print(f"repository-version={repository_version}")
  79. print(f"version={wheel_version}")
  80. PY
  81. - name: Compute matrix from targets input
  82. id: plan
  83. env:
  84. # Blank dispatch inputs build all targets.
  85. TARGETS: ${{ inputs.targets || 'node24-linux-x64,node24-linux-arm64,node24-macos-arm64,node24-macos-x64,node24-win-x64' }}
  86. run: |
  87. set -euo pipefail
  88. matrix='[]'
  89. IFS=',' read -r -a targets <<< "$TARGETS"
  90. for raw in "${targets[@]}"; do
  91. t="$(echo "$raw" | xargs)" # trim surrounding whitespace
  92. [ -z "$t" ] && continue
  93. # Native-only: hosted arm64 Linux uses ubuntu-24.04-arm, while
  94. # macos-latest is Apple Silicon; macos-15-intel is native x64.
  95. case "$t" in
  96. node24-linux-x64) runner=ubuntu-latest ;;
  97. node24-linux-arm64) runner=ubuntu-24.04-arm ;;
  98. node24-macos-arm64) runner=macos-latest ;;
  99. node24-macos-x64) runner=macos-15-intel ;;
  100. node24-win-x64) runner=windows-2025 ;;
  101. *)
  102. echo "::error::Unknown target '$t'. Supported: node24-linux-x64, node24-linux-arm64, node24-macos-arm64, node24-macos-x64, node24-win-x64."
  103. exit 1
  104. ;;
  105. esac
  106. matrix="$(jq -c --arg target "$t" --arg runner "$runner" '. + [{target: $target, runner: $runner}]' <<< "$matrix")"
  107. done
  108. if [ "$matrix" = '[]' ]; then
  109. echo "::error::The targets input selected nothing to build."
  110. exit 1
  111. fi
  112. echo "Matrix: $matrix"
  113. echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
  114. sdk-wheel:
  115. needs: plan
  116. name: deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
  117. runs-on: ubuntu-latest
  118. timeout-minutes: 5
  119. steps:
  120. - uses: actions/checkout@v6
  121. - uses: actions/setup-python@v6.3.0
  122. with:
  123. python-version: '3.10'
  124. - name: Install Python build tooling
  125. run: python -m pip install uv==0.11.23
  126. - name: Build release-shaped SDK wheel
  127. run: >-
  128. python scripts/build-python-release.py
  129. --package sdk
  130. --output-dir dist-python
  131. - uses: actions/upload-artifact@v7
  132. with:
  133. name: deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
  134. path: dist-python/deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
  135. if-no-files-found: error
  136. retention-days: 7
  137. build:
  138. needs: [plan, sdk-wheel]
  139. name: ${{ matrix.target }}
  140. runs-on: ${{ matrix.runner }}
  141. timeout-minutes: 45
  142. strategy:
  143. fail-fast: false
  144. matrix:
  145. include: ${{ fromJSON(needs.plan.outputs.matrix) }}
  146. steps:
  147. - uses: actions/checkout@v6
  148. with:
  149. persist-credentials: false
  150. - uses: pnpm/action-setup@v4
  151. with:
  152. dest: ${{ runner.temp }}/setup-pnpm-js-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  153. - name: Enable Windows Developer Mode (symlink support)
  154. if: runner.os == 'Windows'
  155. shell: pwsh
  156. run: >-
  157. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
  158. /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  159. # setup-node's built-in pnpm store cache keys on platform AND arch, so
  160. # the Linux architectures sharing runner.os stay on separate caches.
  161. - uses: actions/setup-node@v6
  162. with:
  163. node-version: 24
  164. cache: pnpm
  165. - uses: actions/setup-python@v6.3.0
  166. with:
  167. python-version: '3.10'
  168. - name: Install Python build tooling
  169. run: python -m pip install uv==0.11.23
  170. # Cache pkg's target Node binary; lockfile changes roll the
  171. # exact key while the restore prefix can seed its replacement.
  172. - uses: actions/cache@v4
  173. with:
  174. path: ~/.pkg-cache
  175. key: pkg-fetch-${{ matrix.target }}-${{ hashFiles('pnpm-lock.yaml') }}
  176. restore-keys: |
  177. pkg-fetch-${{ matrix.target }}-
  178. - name: Install (immutable)
  179. # node-gyp fetches Node headers from nodejs.org during install; that
  180. # endpoint stalls intermittently (observed 10 s connect timeouts).
  181. # Bounded retries mirror the wine lane's transfer policy without a
  182. # mirror, since these installs also resolve native addons.
  183. shell: bash
  184. run: |
  185. for attempt in 1 2 3; do
  186. if pnpm install --frozen-lockfile; then exit 0; fi
  187. [ "$attempt" -lt 3 ] && sleep 10
  188. done
  189. exit 1
  190. - name: Rebuild Linux node-pty against manylinux 2.28
  191. if: runner.os == 'Linux'
  192. env:
  193. RUNNER_ARCH: ${{ runner.arch }}
  194. run: |
  195. set -euo pipefail
  196. case "$RUNNER_ARCH" in
  197. X64) image=quay.io/pypa/manylinux_2_28_x86_64 ;;
  198. ARM64) image=quay.io/pypa/manylinux_2_28_aarch64 ;;
  199. *) echo "::error::Unsupported Linux runner architecture $RUNNER_ARCH"; exit 1 ;;
  200. esac
  201. addon_dir="$(realpath packages/subprocess/subprocess-local/node_modules/node-pty)"
  202. pnpm_setup_root="$(realpath "$(dirname "$(dirname "$PNPM_HOME")")")"
  203. (cd "$addon_dir" && npm_config_build_from_source=true pnpm run install)
  204. addon="$addon_dir/build/Release/pty.node"
  205. [ -f "$addon_dir/build/Makefile" ] || {
  206. echo "::error::node-pty install did not generate $addon_dir/build/Makefile"
  207. exit 1
  208. }
  209. docker run --rm \
  210. --user "$(id -u):$(id -g)" \
  211. -v "$PWD:$PWD" \
  212. -v "$HOME/.cache/node-gyp:$HOME/.cache/node-gyp:ro" \
  213. -v "$pnpm_setup_root:$pnpm_setup_root:ro" \
  214. -w "$addon_dir" \
  215. "$image" \
  216. bash -euxo pipefail -c \
  217. 'rm -rf build/Release && make -C build -j2 BUILDTYPE=Release'
  218. [ -f "$addon" ] || { echo "::error::$addon missing after manylinux rebuild"; exit 1; }
  219. readelf --version-info "$addon" | tee node-pty-glibc-versions.txt
  220. maximum="$(sed -n 's/.*Name: GLIBC_\([0-9.]*\).*/\1/p' node-pty-glibc-versions.txt | sort -V | tail -1)"
  221. [ -n "$maximum" ] || { echo "::error::No GLIBC requirements found in $addon"; exit 1; }
  222. dpkg --compare-versions "$maximum" le 2.28 || {
  223. echo "::error::node-pty addon requires GLIBC_$maximum but wheel claims manylinux_2_28"
  224. exit 1
  225. }
  226. - name: Build single-exe
  227. env:
  228. DSH_BUILD_CLIENT_PROFILE: official
  229. run: pnpm exec tsx scripts/build-exe-for-python-sdk.ts --targets=${{ matrix.target }}
  230. - name: Resolve platform outputs (POSIX)
  231. id: runtime-posix
  232. if: runner.os != 'Windows'
  233. env:
  234. TARGET: ${{ matrix.target }}
  235. VERSION: ${{ needs.plan.outputs.version }}
  236. run: |
  237. set -euo pipefail
  238. platform="${TARGET#node24-}"
  239. exe="$PWD/dist-exe/deepseek-harness-sdk-runtime-$platform"
  240. case "$platform" in
  241. linux-x64) wheel=deepseek_harness_runtime_bin-$VERSION-py3-none-manylinux_2_28_x86_64.whl ;;
  242. linux-arm64) wheel=deepseek_harness_runtime_bin-$VERSION-py3-none-manylinux_2_28_aarch64.whl ;;
  243. macos-arm64) wheel=deepseek_harness_runtime_bin-$VERSION-py3-none-macosx_14_0_arm64.whl ;;
  244. macos-x64) wheel=deepseek_harness_runtime_bin-$VERSION-py3-none-macosx_14_0_x86_64.whl ;;
  245. *) echo "::error::Unsupported runtime platform $platform"; exit 1 ;;
  246. esac
  247. [ -x "$exe" ] || { echo "::error::$exe missing or not executable"; exit 1; }
  248. echo "platform=$platform" >> "$GITHUB_OUTPUT"
  249. echo "exe=$exe" >> "$GITHUB_OUTPUT"
  250. echo "wheel=$wheel" >> "$GITHUB_OUTPUT"
  251. - name: Resolve platform outputs (Windows)
  252. id: runtime-windows
  253. if: runner.os == 'Windows'
  254. shell: pwsh
  255. env:
  256. TARGET: ${{ matrix.target }}
  257. VERSION: ${{ needs.plan.outputs.version }}
  258. run: |
  259. if ($env:TARGET -ne 'node24-win-x64') { throw "Unsupported runtime target $env:TARGET" }
  260. $platform = 'win-x64'
  261. $exe = Join-Path $PWD 'dist-exe\deepseek-harness-sdk-runtime-win-x64.exe'
  262. $wheel = "deepseek_harness_runtime_bin-$env:VERSION-py3-none-win_amd64.whl"
  263. if (-not (Test-Path -LiteralPath $exe -PathType Leaf)) { throw "Runtime executable is missing at $exe" }
  264. "platform=$platform" >> $env:GITHUB_OUTPUT
  265. "exe=$exe" >> $env:GITHUB_OUTPUT
  266. "wheel=$wheel" >> $env:GITHUB_OUTPUT
  267. - name: Build release-shaped runtime wheel
  268. run: >-
  269. python scripts/build-python-release.py
  270. --package runtime
  271. --platform "${{ steps.runtime-posix.outputs.platform || steps.runtime-windows.outputs.platform }}"
  272. --runtime-exe "${{ steps.runtime-posix.outputs.exe || steps.runtime-windows.outputs.exe }}"
  273. --output-dir dist-python
  274. - uses: actions/download-artifact@v8
  275. with:
  276. name: deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
  277. path: dist-python
  278. - name: Install local SDK and runtime wheels into a clean venv (POSIX)
  279. id: smoke-venv-posix
  280. if: runner.os != 'Windows'
  281. env:
  282. RUNTIME_WHEEL: ${{ steps.runtime-posix.outputs.wheel }}
  283. SDK_WHEEL: deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
  284. run: |
  285. set -euo pipefail
  286. venv="$(python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-smoke-"))')"
  287. python -m venv "$venv"
  288. smoke_python="$venv/bin/python"
  289. "$smoke_python" -m pip install \
  290. "dist-python/$SDK_WHEEL" \
  291. "dist-python/$RUNTIME_WHEEL"
  292. echo "python=$smoke_python" >> "$GITHUB_OUTPUT"
  293. - name: Install local SDK and runtime wheels into a clean venv (Windows)
  294. id: smoke-venv-windows
  295. if: runner.os == 'Windows'
  296. shell: pwsh
  297. env:
  298. RUNTIME_WHEEL: ${{ steps.runtime-windows.outputs.wheel }}
  299. SDK_WHEEL: deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
  300. run: |
  301. $venv = (& python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-smoke-"))').Trim()
  302. python -m venv $venv
  303. $smokePython = Join-Path $venv 'Scripts\python.exe'
  304. & $smokePython -m pip install "dist-python/$env:SDK_WHEEL" "dist-python/$env:RUNTIME_WHEEL"
  305. if ($LASTEXITCODE -ne 0) { throw "Wheel installation failed with exit code $LASTEXITCODE" }
  306. "python=$smokePython" >> $env:GITHUB_OUTPUT
  307. - name: Run installed-wheel keyless black-box tests (POSIX)
  308. if: runner.os != 'Windows'
  309. run: |
  310. set -euo pipefail
  311. blackbox_root="$(python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-blackbox-"))')"
  312. cd "$blackbox_root"
  313. env -u PYTHONPATH -u DSH_RUNTIME_MODE \
  314. "${{ steps.smoke-venv-posix.outputs.python }}" \
  315. "$GITHUB_WORKSPACE/scripts/smoke-python-runtime.py" \
  316. --scenario all \
  317. --installed-wheel
  318. - name: Run installed-wheel keyless black-box tests (Windows)
  319. if: runner.os == 'Windows'
  320. shell: pwsh
  321. run: |
  322. $blackboxRoot = (& python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-blackbox-"))').Trim()
  323. Remove-Item Env:PYTHONPATH -ErrorAction SilentlyContinue
  324. Remove-Item Env:DSH_RUNTIME_MODE -ErrorAction SilentlyContinue
  325. Push-Location $blackboxRoot
  326. try {
  327. & "${{ steps.smoke-venv-windows.outputs.python }}" "$env:GITHUB_WORKSPACE\scripts\smoke-python-runtime.py" --scenario all --installed-wheel
  328. if ($LASTEXITCODE -ne 0) { throw "Installed-wheel black-box failed with exit code $LASTEXITCODE" }
  329. } finally {
  330. Pop-Location
  331. }
  332. - name: Preflight installed-wheel real API test (POSIX)
  333. if: >-
  334. inputs.ci
  335. && runner.os != 'Windows'
  336. && (github.event_name != 'pull_request'
  337. || !(github.event.pull_request.head.repo.fork
  338. || github.event.pull_request.user.login == 'dependabot[bot]'))
  339. env:
  340. DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}
  341. run: |
  342. set -euo pipefail
  343. if [ -z "${DEEPSEEK_API_KEY:-}" ]; then
  344. echo "::error::DEEPSEEK_API_KEY_EXTERNAL is empty; the installed-wheel real API test cannot self-skip."
  345. exit 1
  346. fi
  347. - name: Preflight installed-wheel real API test (Windows)
  348. if: >-
  349. inputs.ci
  350. && runner.os == 'Windows'
  351. && (github.event_name != 'pull_request'
  352. || !(github.event.pull_request.head.repo.fork
  353. || github.event.pull_request.user.login == 'dependabot[bot]'))
  354. shell: pwsh
  355. env:
  356. DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}
  357. run: |
  358. if ([string]::IsNullOrWhiteSpace($env:DEEPSEEK_API_KEY)) {
  359. throw 'DEEPSEEK_API_KEY_EXTERNAL is empty; the installed-wheel real API test cannot self-skip.'
  360. }
  361. - name: Run installed-wheel real API black-box test (POSIX)
  362. if: >-
  363. inputs.ci
  364. && runner.os != 'Windows'
  365. && (github.event_name != 'pull_request'
  366. || !(github.event.pull_request.head.repo.fork
  367. || github.event.pull_request.user.login == 'dependabot[bot]'))
  368. env:
  369. DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}
  370. DEEPSEEK_BASE_URL: https://api.deepseek.com
  371. run: |
  372. set -euo pipefail
  373. blackbox_root="$(python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-blackbox-live-"))')"
  374. cd "$blackbox_root"
  375. env -u PYTHONPATH -u DSH_RUNTIME_MODE \
  376. "${{ steps.smoke-venv-posix.outputs.python }}" \
  377. "$GITHUB_WORKSPACE/scripts/smoke-python-runtime.py" \
  378. --scenario sdk-live \
  379. --installed-wheel
  380. - name: Run installed-wheel real API black-box test (Windows)
  381. if: >-
  382. inputs.ci
  383. && runner.os == 'Windows'
  384. && (github.event_name != 'pull_request'
  385. || !(github.event.pull_request.head.repo.fork
  386. || github.event.pull_request.user.login == 'dependabot[bot]'))
  387. shell: pwsh
  388. env:
  389. DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}
  390. DEEPSEEK_BASE_URL: https://api.deepseek.com
  391. run: |
  392. $blackboxRoot = (& python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-blackbox-live-"))').Trim()
  393. Remove-Item Env:PYTHONPATH -ErrorAction SilentlyContinue
  394. Remove-Item Env:DSH_RUNTIME_MODE -ErrorAction SilentlyContinue
  395. Push-Location $blackboxRoot
  396. try {
  397. & "${{ steps.smoke-venv-windows.outputs.python }}" "$env:GITHUB_WORKSPACE\scripts\smoke-python-runtime.py" --scenario sdk-live --installed-wheel
  398. if ($LASTEXITCODE -ne 0) { throw "Installed-wheel live API smoke failed with exit code $LASTEXITCODE" }
  399. } finally {
  400. Pop-Location
  401. }
  402. - name: Check Linux GLIBC requirements
  403. if: runner.os == 'Linux'
  404. run: |
  405. set -euo pipefail
  406. readelf --version-info "${{ steps.runtime-posix.outputs.exe }}" | tee glibc-versions.txt
  407. maximum="$(sed -n 's/.*Name: GLIBC_\([0-9.]*\).*/\1/p' glibc-versions.txt | sort -V | tail -1)"
  408. [ -n "$maximum" ] || { echo "::error::No GLIBC requirements found"; exit 1; }
  409. dpkg --compare-versions "$maximum" le 2.28 || {
  410. echo "::error::Executable requires GLIBC_$maximum but wheel claims manylinux_2_28"
  411. exit 1
  412. }
  413. - name: Check macOS payload architecture and deployment target
  414. if: runner.os == 'macOS'
  415. env:
  416. EXE: ${{ steps.runtime-posix.outputs.exe }}
  417. PLATFORM: ${{ steps.runtime-posix.outputs.platform }}
  418. run: |
  419. set -euo pipefail
  420. case "$PLATFORM" in
  421. macos-arm64) macho_arch=arm64 ;;
  422. macos-x64) macho_arch=x86_64 ;;
  423. *) echo "::error::Unsupported macOS platform $PLATFORM"; exit 1 ;;
  424. esac
  425. for payload in "$EXE" "$EXE-rg" "$EXE-spawn-helper"; do
  426. lipo "$payload" -verify_arch "$macho_arch"
  427. done
  428. python3 scripts/check-macos-deployment-target.py \
  429. --platform "$PLATFORM" "$EXE" "$EXE-rg" "$EXE-spawn-helper"
  430. - name: Run wheel in a manylinux 2.28 container
  431. if: runner.os == 'Linux'
  432. env:
  433. RUNNER_ARCH: ${{ runner.arch }}
  434. RUNTIME_WHEEL: ${{ steps.runtime-posix.outputs.wheel }}
  435. SDK_WHEEL: deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
  436. run: |
  437. set -euo pipefail
  438. case "$RUNNER_ARCH" in
  439. X64) image=quay.io/pypa/manylinux_2_28_x86_64 ;;
  440. ARM64) image=quay.io/pypa/manylinux_2_28_aarch64 ;;
  441. *) echo "::error::Unsupported Linux runner architecture $RUNNER_ARCH"; exit 1 ;;
  442. esac
  443. docker run --rm -e RUNTIME_WHEEL -e SDK_WHEEL -e DSH_TELEMETRY_DISABLED -v "$PWD:/work" -w /work "$image" bash -euxo pipefail -c '
  444. /opt/python/cp310-cp310/bin/python -m venv /tmp/dsh-sdk
  445. /tmp/dsh-sdk/bin/python -m pip install "/work/dist-python/$SDK_WHEEL" "/work/dist-python/$RUNTIME_WHEEL"
  446. mkdir -p /tmp/dsh-sdk-manylinux-smoke
  447. cd /tmp/dsh-sdk-manylinux-smoke
  448. env -u PYTHONPATH -u DSH_RUNTIME_MODE /tmp/dsh-sdk/bin/python /work/scripts/smoke-python-runtime.py --scenario sdk-default --installed-wheel
  449. env -u PYTHONPATH -u DSH_RUNTIME_MODE /tmp/dsh-sdk/bin/python /work/scripts/smoke-python-runtime.py --scenario sdk-mcp --installed-wheel
  450. '
  451. - uses: actions/upload-artifact@v7
  452. with:
  453. name: ${{ steps.runtime-posix.outputs.wheel || steps.runtime-windows.outputs.wheel }}
  454. path: dist-python/${{ steps.runtime-posix.outputs.wheel || steps.runtime-windows.outputs.wheel }}
  455. if-no-files-found: error
  456. retention-days: 7