|
|
@@ -2,7 +2,7 @@ name: Build single-exe
|
|
|
|
|
|
# Native builds for the release targets; see
|
|
|
# .agents/notes/implemented/architecture/2026-07-10-single-file-executable-sdk-runtime-distribution.md.
|
|
|
-# A full target run retains one SDK wheel and three runtime wheels; subset
|
|
|
+# A full target run retains one SDK wheel and four runtime wheels; subset
|
|
|
# dispatch retains the SDK wheel and selected runtime wheels. Bare executables
|
|
|
# and source closures are test inputs. Run manually, label a PR `build-exe`
|
|
|
# (remove and reapply to rerun), or call it from the Python release workflow.
|
|
|
@@ -11,7 +11,7 @@ on:
|
|
|
workflow_call:
|
|
|
inputs:
|
|
|
targets:
|
|
|
- description: Comma-separated pkg targets to build; empty builds all three.
|
|
|
+ description: Comma-separated pkg targets to build; empty builds all four.
|
|
|
type: string
|
|
|
required: false
|
|
|
default: ''
|
|
|
@@ -34,8 +34,8 @@ on:
|
|
|
targets:
|
|
|
description: >-
|
|
|
Comma-separated pkg targets to build. Any subset of:
|
|
|
- node24-linux-x64, node24-linux-arm64, node24-macos-arm64.
|
|
|
- Empty builds all three.
|
|
|
+ node24-linux-x64, node24-linux-arm64, node24-macos-arm64,
|
|
|
+ node24-win-x64. Empty builds all four.
|
|
|
type: string
|
|
|
required: false
|
|
|
default: ''
|
|
|
@@ -90,7 +90,7 @@ jobs:
|
|
|
id: plan
|
|
|
env:
|
|
|
# Label runs and blank dispatch inputs build all targets.
|
|
|
- TARGETS: ${{ inputs.targets || 'node24-linux-x64,node24-linux-arm64,node24-macos-arm64' }}
|
|
|
+ TARGETS: ${{ inputs.targets || 'node24-linux-x64,node24-linux-arm64,node24-macos-arm64,node24-win-x64' }}
|
|
|
run: |
|
|
|
set -euo pipefail
|
|
|
matrix='[]'
|
|
|
@@ -104,8 +104,9 @@ jobs:
|
|
|
node24-linux-x64) runner=ubuntu-latest ;;
|
|
|
node24-linux-arm64) runner=ubuntu-24.04-arm ;;
|
|
|
node24-macos-arm64) runner=macos-latest ;;
|
|
|
+ node24-win-x64) runner=windows-2025 ;;
|
|
|
*)
|
|
|
- echo "::error::Unknown target '$t'. Supported: node24-linux-x64, node24-linux-arm64, node24-macos-arm64."
|
|
|
+ echo "::error::Unknown target '$t'. Supported: node24-linux-x64, node24-linux-arm64, node24-macos-arm64, node24-win-x64."
|
|
|
exit 1
|
|
|
;;
|
|
|
esac
|
|
|
@@ -159,6 +160,15 @@ jobs:
|
|
|
- uses: actions/checkout@v6
|
|
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
|
+ with:
|
|
|
+ dest: ${{ runner.temp }}/setup-pnpm-js
|
|
|
+
|
|
|
+ - name: Enable Windows Developer Mode (symlink support)
|
|
|
+ if: runner.os == 'Windows'
|
|
|
+ shell: pwsh
|
|
|
+ run: >-
|
|
|
+ reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
|
|
|
+ /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
|
|
|
|
|
|
# setup-node's built-in pnpm store cache keys on platform AND arch, so
|
|
|
# the Linux architectures sharing runner.os stay on separate caches.
|
|
|
@@ -198,6 +208,7 @@ jobs:
|
|
|
*) echo "::error::Unsupported Linux runner architecture $RUNNER_ARCH"; exit 1 ;;
|
|
|
esac
|
|
|
addon_dir="$(realpath packages/subprocess/subprocess-local/node_modules/node-pty)"
|
|
|
+ pnpm_setup_root="$(realpath "$(dirname "$(dirname "$PNPM_HOME")")")"
|
|
|
(cd "$addon_dir" && npm_config_build_from_source=true pnpm run install)
|
|
|
addon="$addon_dir/build/Release/pty.node"
|
|
|
[ -f "$addon_dir/build/Makefile" ] || {
|
|
|
@@ -208,7 +219,7 @@ jobs:
|
|
|
--user "$(id -u):$(id -g)" \
|
|
|
-v "$PWD:$PWD" \
|
|
|
-v "$HOME/.cache/node-gyp:$HOME/.cache/node-gyp:ro" \
|
|
|
- -v "$HOME/setup-pnpm:$HOME/setup-pnpm:ro" \
|
|
|
+ -v "$pnpm_setup_root:$pnpm_setup_root:ro" \
|
|
|
-w "$addon_dir" \
|
|
|
"$image" \
|
|
|
bash -euxo pipefail -c \
|
|
|
@@ -227,8 +238,9 @@ jobs:
|
|
|
DSH_BUILD_CLIENT_PROFILE: official
|
|
|
run: pnpm exec tsx scripts/build-exe-for-python-sdk.ts --targets=${{ matrix.target }}
|
|
|
|
|
|
- - name: Resolve platform outputs
|
|
|
- id: runtime
|
|
|
+ - name: Resolve platform outputs (POSIX)
|
|
|
+ id: runtime-posix
|
|
|
+ if: runner.os != 'Windows'
|
|
|
env:
|
|
|
TARGET: ${{ matrix.target }}
|
|
|
VERSION: ${{ needs.plan.outputs.version }}
|
|
|
@@ -236,23 +248,40 @@ jobs:
|
|
|
set -euo pipefail
|
|
|
platform="${TARGET#node24-}"
|
|
|
exe="$PWD/dist-exe/deepseek-harness-sdk-runtime-$platform"
|
|
|
- [ -x "$exe" ] || { echo "::error::$exe missing or not executable"; exit 1; }
|
|
|
case "$platform" in
|
|
|
linux-x64) wheel=deepseek_harness_runtime_bin-$VERSION-py3-none-manylinux_2_28_x86_64.whl ;;
|
|
|
linux-arm64) wheel=deepseek_harness_runtime_bin-$VERSION-py3-none-manylinux_2_28_aarch64.whl ;;
|
|
|
macos-arm64) wheel=deepseek_harness_runtime_bin-$VERSION-py3-none-macosx_14_0_arm64.whl ;;
|
|
|
*) echo "::error::Unsupported runtime platform $platform"; exit 1 ;;
|
|
|
esac
|
|
|
+ [ -x "$exe" ] || { echo "::error::$exe missing or not executable"; exit 1; }
|
|
|
echo "platform=$platform" >> "$GITHUB_OUTPUT"
|
|
|
echo "exe=$exe" >> "$GITHUB_OUTPUT"
|
|
|
echo "wheel=$wheel" >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
+ - name: Resolve platform outputs (Windows)
|
|
|
+ id: runtime-windows
|
|
|
+ if: runner.os == 'Windows'
|
|
|
+ shell: pwsh
|
|
|
+ env:
|
|
|
+ TARGET: ${{ matrix.target }}
|
|
|
+ VERSION: ${{ needs.plan.outputs.version }}
|
|
|
+ run: |
|
|
|
+ if ($env:TARGET -ne 'node24-win-x64') { throw "Unsupported runtime target $env:TARGET" }
|
|
|
+ $platform = 'win-x64'
|
|
|
+ $exe = Join-Path $PWD 'dist-exe\deepseek-harness-sdk-runtime-win-x64.exe'
|
|
|
+ $wheel = "deepseek_harness_runtime_bin-$env:VERSION-py3-none-win_amd64.whl"
|
|
|
+ if (-not (Test-Path -LiteralPath $exe -PathType Leaf)) { throw "Runtime executable is missing at $exe" }
|
|
|
+ "platform=$platform" >> $env:GITHUB_OUTPUT
|
|
|
+ "exe=$exe" >> $env:GITHUB_OUTPUT
|
|
|
+ "wheel=$wheel" >> $env:GITHUB_OUTPUT
|
|
|
+
|
|
|
- name: Build release-shaped runtime wheel
|
|
|
run: >-
|
|
|
python scripts/build-python-release.py
|
|
|
--package runtime
|
|
|
- --platform "${{ steps.runtime.outputs.platform }}"
|
|
|
- --runtime-exe "${{ steps.runtime.outputs.exe }}"
|
|
|
+ --platform "${{ steps.runtime-posix.outputs.platform || steps.runtime-windows.outputs.platform }}"
|
|
|
+ --runtime-exe "${{ steps.runtime-posix.outputs.exe || steps.runtime-windows.outputs.exe }}"
|
|
|
--output-dir dist-python
|
|
|
|
|
|
- uses: actions/download-artifact@v8
|
|
|
@@ -260,32 +289,68 @@ jobs:
|
|
|
name: deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
|
|
|
path: dist-python
|
|
|
|
|
|
- - name: Install local SDK and runtime wheels into a clean venv
|
|
|
+ - name: Install local SDK and runtime wheels into a clean venv (POSIX)
|
|
|
+ id: smoke-venv-posix
|
|
|
+ if: runner.os != 'Windows'
|
|
|
env:
|
|
|
- RUNTIME_WHEEL: ${{ steps.runtime.outputs.wheel }}
|
|
|
+ RUNTIME_WHEEL: ${{ steps.runtime-posix.outputs.wheel }}
|
|
|
SDK_WHEEL: deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
|
|
|
run: |
|
|
|
set -euo pipefail
|
|
|
- python -m venv "$RUNNER_TEMP/dsh-sdk-smoke"
|
|
|
- "$RUNNER_TEMP/dsh-sdk-smoke/bin/python" -m pip install \
|
|
|
+ venv="$(python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-smoke-"))')"
|
|
|
+ python -m venv "$venv"
|
|
|
+ smoke_python="$venv/bin/python"
|
|
|
+ "$smoke_python" -m pip install \
|
|
|
"dist-python/$SDK_WHEEL" \
|
|
|
"dist-python/$RUNTIME_WHEEL"
|
|
|
+ echo "python=$smoke_python" >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
- - name: Run installed-wheel keyless black-box tests
|
|
|
+ - name: Install local SDK and runtime wheels into a clean venv (Windows)
|
|
|
+ id: smoke-venv-windows
|
|
|
+ if: runner.os == 'Windows'
|
|
|
+ shell: pwsh
|
|
|
+ env:
|
|
|
+ RUNTIME_WHEEL: ${{ steps.runtime-windows.outputs.wheel }}
|
|
|
+ SDK_WHEEL: deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
|
|
|
+ run: |
|
|
|
+ $venv = (& python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-smoke-"))').Trim()
|
|
|
+ python -m venv $venv
|
|
|
+ $smokePython = Join-Path $venv 'Scripts\python.exe'
|
|
|
+ & $smokePython -m pip install "dist-python/$env:SDK_WHEEL" "dist-python/$env:RUNTIME_WHEEL"
|
|
|
+ if ($LASTEXITCODE -ne 0) { throw "Wheel installation failed with exit code $LASTEXITCODE" }
|
|
|
+ "python=$smokePython" >> $env:GITHUB_OUTPUT
|
|
|
+
|
|
|
+ - name: Run installed-wheel keyless black-box tests (POSIX)
|
|
|
+ if: runner.os != 'Windows'
|
|
|
run: |
|
|
|
set -euo pipefail
|
|
|
- blackbox_root="$RUNNER_TEMP/dsh-sdk-blackbox"
|
|
|
- mkdir -p "$blackbox_root"
|
|
|
+ blackbox_root="$(python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-blackbox-"))')"
|
|
|
cd "$blackbox_root"
|
|
|
env -u PYTHONPATH -u DSH_RUNTIME_MODE \
|
|
|
- "$RUNNER_TEMP/dsh-sdk-smoke/bin/python" \
|
|
|
+ "${{ steps.smoke-venv-posix.outputs.python }}" \
|
|
|
"$GITHUB_WORKSPACE/scripts/smoke-python-runtime.py" \
|
|
|
--scenario all \
|
|
|
--installed-wheel
|
|
|
|
|
|
- - name: Preflight installed-wheel real API test
|
|
|
+ - name: Run installed-wheel keyless black-box tests (Windows)
|
|
|
+ if: runner.os == 'Windows'
|
|
|
+ shell: pwsh
|
|
|
+ run: |
|
|
|
+ $blackboxRoot = (& python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-blackbox-"))').Trim()
|
|
|
+ Remove-Item Env:PYTHONPATH -ErrorAction SilentlyContinue
|
|
|
+ Remove-Item Env:DSH_RUNTIME_MODE -ErrorAction SilentlyContinue
|
|
|
+ Push-Location $blackboxRoot
|
|
|
+ try {
|
|
|
+ & "${{ steps.smoke-venv-windows.outputs.python }}" "$env:GITHUB_WORKSPACE\scripts\smoke-python-runtime.py" --scenario all --installed-wheel
|
|
|
+ if ($LASTEXITCODE -ne 0) { throw "Installed-wheel black-box failed with exit code $LASTEXITCODE" }
|
|
|
+ } finally {
|
|
|
+ Pop-Location
|
|
|
+ }
|
|
|
+
|
|
|
+ - name: Preflight installed-wheel real API test (POSIX)
|
|
|
if: >-
|
|
|
inputs.ci
|
|
|
+ && runner.os != 'Windows'
|
|
|
&& (github.event_name != 'pull_request'
|
|
|
|| !(github.event.pull_request.head.repo.fork
|
|
|
|| github.event.pull_request.user.login == 'dependabot[bot]'))
|
|
|
@@ -298,9 +363,25 @@ jobs:
|
|
|
exit 1
|
|
|
fi
|
|
|
|
|
|
- - name: Run installed-wheel real API black-box test
|
|
|
+ - name: Preflight installed-wheel real API test (Windows)
|
|
|
if: >-
|
|
|
inputs.ci
|
|
|
+ && runner.os == 'Windows'
|
|
|
+ && (github.event_name != 'pull_request'
|
|
|
+ || !(github.event.pull_request.head.repo.fork
|
|
|
+ || github.event.pull_request.user.login == 'dependabot[bot]'))
|
|
|
+ shell: pwsh
|
|
|
+ env:
|
|
|
+ DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}
|
|
|
+ run: |
|
|
|
+ if ([string]::IsNullOrWhiteSpace($env:DEEPSEEK_API_KEY)) {
|
|
|
+ throw 'DEEPSEEK_API_KEY_EXTERNAL is empty; the installed-wheel real API test cannot self-skip.'
|
|
|
+ }
|
|
|
+
|
|
|
+ - name: Run installed-wheel real API black-box test (POSIX)
|
|
|
+ if: >-
|
|
|
+ inputs.ci
|
|
|
+ && runner.os != 'Windows'
|
|
|
&& (github.event_name != 'pull_request'
|
|
|
|| !(github.event.pull_request.head.repo.fork
|
|
|
|| github.event.pull_request.user.login == 'dependabot[bot]'))
|
|
|
@@ -309,20 +390,42 @@ jobs:
|
|
|
DEEPSEEK_BASE_URL: https://api.deepseek.com
|
|
|
run: |
|
|
|
set -euo pipefail
|
|
|
- blackbox_root="$RUNNER_TEMP/dsh-sdk-blackbox-live"
|
|
|
- mkdir -p "$blackbox_root"
|
|
|
+ blackbox_root="$(python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-blackbox-live-"))')"
|
|
|
cd "$blackbox_root"
|
|
|
env -u PYTHONPATH -u DSH_RUNTIME_MODE \
|
|
|
- "$RUNNER_TEMP/dsh-sdk-smoke/bin/python" \
|
|
|
+ "${{ steps.smoke-venv-posix.outputs.python }}" \
|
|
|
"$GITHUB_WORKSPACE/scripts/smoke-python-runtime.py" \
|
|
|
--scenario sdk-live \
|
|
|
--installed-wheel
|
|
|
|
|
|
+ - name: Run installed-wheel real API black-box test (Windows)
|
|
|
+ if: >-
|
|
|
+ inputs.ci
|
|
|
+ && runner.os == 'Windows'
|
|
|
+ && (github.event_name != 'pull_request'
|
|
|
+ || !(github.event.pull_request.head.repo.fork
|
|
|
+ || github.event.pull_request.user.login == 'dependabot[bot]'))
|
|
|
+ shell: pwsh
|
|
|
+ env:
|
|
|
+ DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}
|
|
|
+ DEEPSEEK_BASE_URL: https://api.deepseek.com
|
|
|
+ run: |
|
|
|
+ $blackboxRoot = (& python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-blackbox-live-"))').Trim()
|
|
|
+ Remove-Item Env:PYTHONPATH -ErrorAction SilentlyContinue
|
|
|
+ Remove-Item Env:DSH_RUNTIME_MODE -ErrorAction SilentlyContinue
|
|
|
+ Push-Location $blackboxRoot
|
|
|
+ try {
|
|
|
+ & "${{ steps.smoke-venv-windows.outputs.python }}" "$env:GITHUB_WORKSPACE\scripts\smoke-python-runtime.py" --scenario sdk-live --installed-wheel
|
|
|
+ if ($LASTEXITCODE -ne 0) { throw "Installed-wheel live API smoke failed with exit code $LASTEXITCODE" }
|
|
|
+ } finally {
|
|
|
+ Pop-Location
|
|
|
+ }
|
|
|
+
|
|
|
- name: Check Linux GLIBC requirements
|
|
|
if: runner.os == 'Linux'
|
|
|
run: |
|
|
|
set -euo pipefail
|
|
|
- readelf --version-info "${{ steps.runtime.outputs.exe }}" | tee glibc-versions.txt
|
|
|
+ readelf --version-info "${{ steps.runtime-posix.outputs.exe }}" | tee glibc-versions.txt
|
|
|
maximum="$(sed -n 's/.*Name: GLIBC_\([0-9.]*\).*/\1/p' glibc-versions.txt | sort -V | tail -1)"
|
|
|
[ -n "$maximum" ] || { echo "::error::No GLIBC requirements found"; exit 1; }
|
|
|
dpkg --compare-versions "$maximum" le 2.28 || {
|
|
|
@@ -333,7 +436,7 @@ jobs:
|
|
|
- name: Check macOS deployment target
|
|
|
if: runner.os == 'macOS'
|
|
|
env:
|
|
|
- EXE: ${{ steps.runtime.outputs.exe }}
|
|
|
+ EXE: ${{ steps.runtime-posix.outputs.exe }}
|
|
|
run: >-
|
|
|
python3 scripts/check-macos-deployment-target.py
|
|
|
"$EXE" "$EXE-spawn-helper"
|
|
|
@@ -342,7 +445,7 @@ jobs:
|
|
|
if: runner.os == 'Linux'
|
|
|
env:
|
|
|
RUNNER_ARCH: ${{ runner.arch }}
|
|
|
- RUNTIME_WHEEL: ${{ steps.runtime.outputs.wheel }}
|
|
|
+ RUNTIME_WHEEL: ${{ steps.runtime-posix.outputs.wheel }}
|
|
|
SDK_WHEEL: deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
|
|
|
run: |
|
|
|
set -euo pipefail
|
|
|
@@ -362,7 +465,7 @@ jobs:
|
|
|
|
|
|
- uses: actions/upload-artifact@v7
|
|
|
with:
|
|
|
- name: ${{ steps.runtime.outputs.wheel }}
|
|
|
- path: dist-python/${{ steps.runtime.outputs.wheel }}
|
|
|
+ name: ${{ steps.runtime-posix.outputs.wheel || steps.runtime-windows.outputs.wheel }}
|
|
|
+ path: dist-python/${{ steps.runtime-posix.outputs.wheel || steps.runtime-windows.outputs.wheel }}
|
|
|
if-no-files-found: error
|
|
|
retention-days: 7
|