|
|
@@ -156,9 +156,6 @@ jobs:
|
|
|
fail-fast: false
|
|
|
matrix:
|
|
|
include: ${{ fromJSON(needs.plan.outputs.matrix) }}
|
|
|
- defaults:
|
|
|
- run:
|
|
|
- shell: bash
|
|
|
steps:
|
|
|
- uses: actions/checkout@v6
|
|
|
|
|
|
@@ -241,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 }}
|
|
|
@@ -254,27 +252,36 @@ jobs:
|
|
|
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 ;;
|
|
|
- win-x64)
|
|
|
- exe="$exe.exe"
|
|
|
- wheel=deepseek_harness_runtime_bin-$VERSION-py3-none-win_amd64.whl
|
|
|
- ;;
|
|
|
*) echo "::error::Unsupported runtime platform $platform"; exit 1 ;;
|
|
|
esac
|
|
|
- if [ "$RUNNER_OS" = Windows ]; then
|
|
|
- [ -f "$exe" ] || { echo "::error::$exe missing"; exit 1; }
|
|
|
- else
|
|
|
- [ -x "$exe" ] || { echo "::error::$exe missing or not executable"; exit 1; }
|
|
|
- fi
|
|
|
+ [ -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
|
|
|
@@ -282,40 +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
|
|
|
- id: smoke-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
|
|
|
venv="$(python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-smoke-"))')"
|
|
|
python -m venv "$venv"
|
|
|
- if [ "$RUNNER_OS" = Windows ]; then
|
|
|
- smoke_python="$(cygpath -u "$venv")/Scripts/python.exe"
|
|
|
- else
|
|
|
- smoke_python="$venv/bin/python"
|
|
|
- fi
|
|
|
+ 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="$(python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-blackbox-"))')"
|
|
|
- if [ "$RUNNER_OS" = Windows ]; then blackbox_root="$(cygpath -u "$blackbox_root")"; fi
|
|
|
cd "$blackbox_root"
|
|
|
env -u PYTHONPATH -u DSH_RUNTIME_MODE \
|
|
|
- "${{ steps.smoke-venv.outputs.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]'))
|
|
|
@@ -328,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]'))
|
|
|
@@ -340,19 +391,41 @@ jobs:
|
|
|
run: |
|
|
|
set -euo pipefail
|
|
|
blackbox_root="$(python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-blackbox-live-"))')"
|
|
|
- if [ "$RUNNER_OS" = Windows ]; then blackbox_root="$(cygpath -u "$blackbox_root")"; fi
|
|
|
cd "$blackbox_root"
|
|
|
env -u PYTHONPATH -u DSH_RUNTIME_MODE \
|
|
|
- "${{ steps.smoke-venv.outputs.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 || {
|
|
|
@@ -363,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"
|
|
|
@@ -372,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
|
|
|
@@ -392,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
|