fork: establish the Marqdo Harness downstream baseline

- keep the full DSH history, MIT license and third-party notices;
- remove upstream publish/upload/desktop packaging workflows so downstream
  CI cannot trigger official credentials or channels;
- exclude the downstream `packages/marqdo/*` packages from the upstream
  bundling graph (they run as TypeScript through Node's type stripping);
- declare app-boot's production peer for the deployed launcher;
- document the product architecture, gates, upstream policy, modification
  log and the M0/M1-M6 evidence.

Upstream: deepseek-harness 4b399c39a6.
Part of marqdo#25 (MDH-00/MDH-02).
This commit is contained in:
cflmy committed 2026-11-28 10:41:04 +08:00
1 parent 4b399c39a6
commit 2d4eef4fe0
31 files changed
+492 -3648

No files matched your search

@@ -1,530 +0,0 @@
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 five runtime wheels; subset
# dispatch retains the SDK wheel and selected runtime wheels. Bare executables
# and source closures are test inputs. Run manually or call it from the Python
# release workflow. There is no `pull_request` trigger: a label trigger would
# list gray skipped checks on every unrelated PR label event. Checkout uses the
# triggering ref, so dispatch needs no separate ref input.
on:
workflow_call:
inputs:
targets:
description: Comma-separated pkg targets to build; empty builds all five.
type: string
required: false
default: ''
release:
description: Run as the native builder for the Python release workflow.
type: boolean
required: false
default: false
ci:
description: Run Python runtime CI validation for the selected targets.
type: boolean
required: false
default: false
secrets:
DEEPSEEK_API_KEY_EXTERNAL:
description: Real DeepSeek API key for trusted installed-wheel pull-request tests.
required: false
workflow_dispatch:
inputs:
targets:
description: >-
Comma-separated pkg targets to build. Any subset of:
node24-linux-x64, node24-linux-arm64, node24-macos-arm64,
node24-macos-x64, node24-win-x64. Empty builds all five.
type: string
required: false
default: ''
concurrency:
# Keep the called workflow distinct from its caller's concurrency group;
# github.workflow identifies the caller inside a reusable workflow and keeps
# an ordinary CI run from cancelling a full release validation on the same ref.
group: build-single-exe-${{ github.workflow }}-${{ github.ref }}
# Release-owned builds are part of an intentional publication transaction.
cancel-in-progress: ${{ !inputs.release }}
permissions:
contents: read
env:
# CI runs must never report to the production telemetry endpoint baked
# into apps/cli/cordis.yml (AppCLIEntry disables the row when set).
DSH_TELEMETRY_DISABLED: '1'
jobs:
# Job-level conditions cannot inspect `matrix`, so validate target names and
# construct the matrix before the dependent jobs.
plan:
name: plan targets
if: inputs.ci || inputs.release || github.event_name == 'workflow_dispatch'
runs-on: >-
${{ inputs.ci && !inputs.release && vars.DSH_CI_FAILOVER_LINUX == 'blacksmith'
&& 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
timeout-minutes: 5
outputs:
matrix: ${{ steps.plan.outputs.matrix }}
version: ${{ steps.version.outputs.version }}
repository-version: ${{ steps.version.outputs.repository-version }}
steps:
- uses: actions/checkout@v7.0.1
- name: Resolve repository version
id: version
run: |
set -euo pipefail
python3 - <<'PY' >> "$GITHUB_OUTPUT"
import runpy
release = runpy.run_path("scripts/build-python-release.py")
repository_version = release["repository_version"]()
wheel_version = release["pep440_version"](repository_version)
print(f"repository-version={repository_version}")
print(f"version={wheel_version}")
PY
- name: Compute matrix from targets input
id: plan
env:
# Blank dispatch inputs build all targets.
TARGETS: ${{ inputs.targets || 'node24-linux-x64,node24-linux-arm64,node24-macos-arm64,node24-macos-x64,node24-win-x64' }}
run: |
set -euo pipefail
matrix='[]'
IFS=',' read -r -a targets <<< "$TARGETS"
for raw in "${targets[@]}"; do
t="$(echo "$raw" | xargs)" # trim surrounding whitespace
[ -z "$t" ] && continue
# Native-only: hosted arm64 Linux uses ubuntu-24.04-arm, while
# macos-latest is Apple Silicon; macos-15-intel is native x64.
case "$t" in
node24-linux-x64) runner=ubuntu-latest ;;
node24-linux-arm64) runner=ubuntu-24.04-arm ;;
node24-macos-arm64) runner=macos-latest ;;
node24-macos-x64) runner=macos-15-intel ;;
node24-win-x64) runner=windows-2025 ;;
*)
echo "::error::Unknown target '$t'. Supported: node24-linux-x64, node24-linux-arm64, node24-macos-arm64, node24-macos-x64, node24-win-x64."
exit 1
;;
esac
matrix="$(jq -c --arg target "$t" --arg runner "$runner" '. + [{target: $target, runner: $runner}]' <<< "$matrix")"
done
if [ "$matrix" = '[]' ]; then
echo "::error::The targets input selected nothing to build."
exit 1
fi
echo "Matrix: $matrix"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
sdk-wheel:
needs: plan
name: deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
runs-on: >-
${{ inputs.ci && !inputs.release && vars.DSH_CI_FAILOVER_LINUX == 'blacksmith'
&& 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
timeout-minutes: 5
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-python@v6.3.0
with:
python-version: '3.10'
- name: Install Python build tooling
run: python -m pip install uv==0.11.23
- name: Build release-shaped SDK wheel
run: >-
python scripts/build-python-release.py
--package sdk
--output-dir dist-python
- uses: actions/upload-artifact@v7.0.1
with:
name: deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
path: dist-python/deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
if-no-files-found: error
retention-days: 7
# Blacksmith x64 CI builds use 2 vCPU for compilation, bundling, and wheel smokes.
# Release macOS builds use larger GitHub runners; ordinary CI and direct
# builder dispatches retain the standard native target matrix.
build:
needs: [plan, sdk-wheel]
name: ${{ matrix.target }}
runs-on: >-
${{ inputs.release && matrix.target == 'node24-macos-x64' && 'macos-15-large'
|| inputs.release && matrix.target == 'node24-macos-arm64' && 'macos-15-xlarge'
|| inputs.ci && !inputs.release && matrix.target == 'node24-linux-x64'
&& vars.DSH_CI_FAILOVER_LINUX == 'blacksmith' && 'blacksmith-2vcpu-ubuntu-2404'
|| inputs.ci && !inputs.release && matrix.target == 'node24-win-x64'
&& vars.DSH_CI_FAILOVER_WINDOWS == 'blacksmith' && 'blacksmith-2vcpu-windows-2025'
|| matrix.runner }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.plan.outputs.matrix) }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: pnpm/action-setup@v5.0.0
with:
dest: ${{ runner.temp }}/setup-pnpm-js-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
- 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.
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
cache: pnpm
- uses: actions/setup-python@v6.3.0
with:
python-version: '3.10'
- name: Install Python build tooling
run: python -m pip install uv==0.11.23
# Cache pkg's target Node binary; lockfile changes roll the
# exact key while the restore prefix can seed its replacement.
- uses: actions/cache@v6.1.0
with:
path: ~/.pkg-cache
key: pkg-fetch-${{ matrix.target }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pkg-fetch-${{ matrix.target }}-
- name: Install (immutable)
# node-gyp fetches Node headers from nodejs.org during install; that
# endpoint stalls intermittently (observed 10 s connect timeouts).
# Bounded retries mirror the wine lane's transfer policy without a
# mirror, since these installs also resolve native addons.
shell: bash
run: |
for attempt in 1 2 3; do
if pnpm install --frozen-lockfile; then exit 0; fi
[ "$attempt" -lt 3 ] && sleep 10
done
exit 1
- name: Rebuild Linux node-pty against manylinux 2.28
if: runner.os == 'Linux'
env:
RUNNER_ARCH: ${{ runner.arch }}
run: |
set -euo pipefail
case "$RUNNER_ARCH" in
X64) image=quay.io/pypa/manylinux_2_28_x86_64 ;;
ARM64) image=quay.io/pypa/manylinux_2_28_aarch64 ;;
*) 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")")")"
# Verification installs would install node-gyp inside the package and package it into the exe.
(cd "$addon_dir" && npm_config_build_from_source=true pnpm --config.verifyDepsBeforeRun=false run install)
addon="$addon_dir/build/Release/pty.node"
[ -f "$addon_dir/build/Makefile" ] || {
echo "::error::node-pty install did not generate $addon_dir/build/Makefile"
exit 1
}
docker run --rm \
--user "$(id -u):$(id -g)" \
-v "$PWD:$PWD" \
-v "$HOME/.cache/node-gyp:$HOME/.cache/node-gyp:ro" \
-v "$pnpm_setup_root:$pnpm_setup_root:ro" \
-w "$addon_dir" \
"$image" \
bash -euxo pipefail -c \
'rm -rf build/Release && make -C build -j2 BUILDTYPE=Release'
[ -f "$addon" ] || { echo "::error::$addon missing after manylinux rebuild"; exit 1; }
readelf --version-info "$addon" | tee node-pty-glibc-versions.txt
maximum="$(sed -n 's/.*Name: GLIBC_\([0-9.]*\).*/\1/p' node-pty-glibc-versions.txt | sort -V | tail -1)"
[ -n "$maximum" ] || { echo "::error::No GLIBC requirements found in $addon"; exit 1; }
dpkg --compare-versions "$maximum" le 2.28 || {
echo "::error::node-pty addon requires GLIBC_$maximum but wheel claims manylinux_2_28"
exit 1
}
- name: Build single-exe
env:
DSH_BUILD_CLIENT_PROFILE: official
# Brotli runs at quality 9 through the vendored pkg patch: the same
# payload measured 16.3 s at quality 9 against 132.8 s at pkg's default
# quality 11, for an archive 10% larger. Which quality each lane uses is
# therefore not a workflow choice.
run: >-
pnpm exec tsx scripts/build-exe-for-python-sdk.ts --targets=${{ matrix.target }}
${{ inputs.ci && github.event_name == 'pull_request' && '--build-artifacts' || '' }}
- name: Resolve platform outputs (POSIX)
id: runtime-posix
if: runner.os != 'Windows'
env:
TARGET: ${{ matrix.target }}
VERSION: ${{ needs.plan.outputs.version }}
run: |
set -euo pipefail
platform="${TARGET#node24-}"
exe="$PWD/dist-exe/deepseek-harness-sdk-runtime-$platform"
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 ;;
macos-x64) wheel=deepseek_harness_runtime_bin-$VERSION-py3-none-macosx_14_0_x86_64.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-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.0.1
with:
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 (POSIX)
id: smoke-venv-posix
if: runner.os != 'Windows'
env:
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"
smoke_python="$venv/bin/python"
"$smoke_python" -m pip install \
"dist-python/$SDK_WHEEL" \
"dist-python/$RUNTIME_WHEEL" \
'pytest>=8.0'
echo "python=$smoke_python" >> "$GITHUB_OUTPUT"
- 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" 'pytest>=8.0'
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-"))')"
cd "$blackbox_root"
env -u PYTHONPATH -u DSH_RUNTIME_MODE \
"${{ steps.smoke-venv-posix.outputs.python }}" \
"$GITHUB_WORKSPACE/scripts/smoke-python-runtime.py" \
--scenario all \
--installed-wheel
- 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: Run installed-wheel native command tests (POSIX)
if: runner.os != 'Windows'
run: >-
"${{ steps.smoke-venv-posix.outputs.python }}" -I
"$GITHUB_WORKSPACE/python/sdk/tests/run_installed_commands.py"
- name: Run installed-wheel native command tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
& "${{ steps.smoke-venv-windows.outputs.python }}" -I "$env:GITHUB_WORKSPACE\python\sdk\tests\run_installed_commands.py"
if ($LASTEXITCODE -ne 0) { throw "Installed-wheel native command tests failed with exit code $LASTEXITCODE" }
- 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]'))
env:
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}
run: |
set -euo pipefail
if [ -z "${DEEPSEEK_API_KEY:-}" ]; then
echo "::error::DEEPSEEK_API_KEY_EXTERNAL is empty; the installed-wheel real API test cannot self-skip."
exit 1
fi
- 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]'))
env:
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}
DEEPSEEK_BASE_URL: https://api.deepseek.com/anthropic
run: |
set -euo pipefail
blackbox_root="$(python -c 'import tempfile; print(tempfile.mkdtemp(prefix="dsh-sdk-blackbox-live-"))')"
cd "$blackbox_root"
env -u PYTHONPATH -u DSH_RUNTIME_MODE \
"${{ 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/anthropic
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-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 || {
echo "::error::Executable requires GLIBC_$maximum but wheel claims manylinux_2_28"
exit 1
}
- name: Check macOS payload architecture and deployment target
if: runner.os == 'macOS'
env:
EXE: ${{ steps.runtime-posix.outputs.exe }}
PLATFORM: ${{ steps.runtime-posix.outputs.platform }}
run: |
set -euo pipefail
case "$PLATFORM" in
macos-arm64) macho_arch=arm64 ;;
macos-x64) macho_arch=x86_64 ;;
*) echo "::error::Unsupported macOS platform $PLATFORM"; exit 1 ;;
esac
for payload in "$EXE" "$EXE-rg" "$EXE-spawn-helper"; do
lipo "$payload" -verify_arch "$macho_arch"
done
python3 scripts/check-macos-deployment-target.py \
--platform "$PLATFORM" "$EXE" "$EXE-rg" "$EXE-spawn-helper"
- name: Run wheel in a manylinux 2.28 container
if: runner.os == 'Linux'
env:
RUNNER_ARCH: ${{ runner.arch }}
RUNTIME_WHEEL: ${{ steps.runtime-posix.outputs.wheel }}
SDK_WHEEL: deepseek_harness_sdk-${{ needs.plan.outputs.version }}-py3-none-any.whl
run: |
set -euo pipefail
case "$RUNNER_ARCH" in
X64) image=quay.io/pypa/manylinux_2_28_x86_64 ;;
ARM64) image=quay.io/pypa/manylinux_2_28_aarch64 ;;
*) echo "::error::Unsupported Linux runner architecture $RUNNER_ARCH"; exit 1 ;;
esac
docker run --rm -e RUNTIME_WHEEL -e SDK_WHEEL -e DSH_TELEMETRY_DISABLED -v "$PWD:/work" -w /work "$image" bash -euxo pipefail -c '
/opt/python/cp310-cp310/bin/python -m venv /tmp/dsh-sdk
/tmp/dsh-sdk/bin/python -m pip install "/work/dist-python/$SDK_WHEEL" "/work/dist-python/$RUNTIME_WHEEL"
mkdir -p /tmp/dsh-sdk-manylinux-smoke
cd /tmp/dsh-sdk-manylinux-smoke
env -u PYTHONPATH -u DSH_RUNTIME_MODE /tmp/dsh-sdk/bin/python /work/scripts/smoke-python-runtime.py --scenario sdk-default --installed-wheel
env -u PYTHONPATH -u DSH_RUNTIME_MODE /tmp/dsh-sdk/bin/python /work/scripts/smoke-python-runtime.py --scenario sdk-mcp --installed-wheel
'
- uses: actions/upload-artifact@v7.0.1
with:
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
@@ -1,127 +0,0 @@
name: Build SSH helper
on:
workflow_call:
inputs:
targets:
description: Comma-separated native Node 24 targets; empty builds all four.
type: string
default: ''
release:
description: Retain a complete release build when another run starts.
type: boolean
default: false
workflow_dispatch:
inputs:
targets:
description: Linux/macOS x64/arm64 pkg targets; empty builds all four.
type: string
default: ''
permissions:
contents: read
concurrency:
group: ssh-helper-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !inputs.release }}
env:
DSH_TELEMETRY_DISABLED: '1'
jobs:
plan:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
matrix: ${{ steps.targets.outputs.matrix }}
steps:
- name: Validate native targets
id: targets
env:
REQUESTED_TARGETS: ${{ inputs.targets }}
run: |
node --input-type=module <<'JS'
import { appendFileSync } from 'node:fs';
const runners = {
'node24-linux-x64': 'ubuntu-24.04',
'node24-linux-arm64': 'ubuntu-24.04-arm',
'node24-macos-arm64': 'macos-latest',
'node24-macos-x64': 'macos-15-intel',
};
const raw = process.env.REQUESTED_TARGETS;
const targets = raw ? raw.split(',').map(value => value.trim()) : Object.keys(runners);
if (new Set(targets).size !== targets.length || targets.some(target => !Object.hasOwn(runners, target))) throw new Error('Invalid or duplicate SSH helper target');
appendFileSync(process.env.GITHUB_OUTPUT, `matrix=${JSON.stringify(targets.map(target => ({target, runner: runners[target]})))}\n`);
JS
build:
needs: plan
name: ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.plan.outputs.matrix) }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
with:
dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v6
with:
node-version: '^24.22.3'
cache: pnpm
- uses: actions/cache@v4
with:
path: ~/.pkg-cache
key: ssh-pkg-${{ matrix.target }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: ssh-pkg-${{ matrix.target }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Prepare Linux compiler and sandbox
if: runner.os == 'Linux'
run: |
sudo apt-get update -q
sudo apt-get install -yq musl-tools bubblewrap
if sysctl kernel.apparmor_restrict_unprivileged_userns >/dev/null 2>&1; then
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
fi
bwrap --ro-bind / / --dev /dev --unshare-pid --proc /proc --die-with-parent -- true
- name: Build compatible Linux PTY addon
if: runner.os == 'Linux'
run: bash scripts/prepare-linux-node-pty.sh
- name: Build native release archive
env:
HELPER_TARGET: ${{ matrix.target }}
run: pnpm exec tsx scripts/build-exe-for-ssh-helper.ts --target="$HELPER_TARGET"
- name: Verify relocated executable and confinement
env:
HELPER_TARGET: ${{ matrix.target }}
run: |
archives=(dist-exe/ssh-helper/*.tar.gz)
test "${#archives[@]}" -eq 1
pnpm exec tsx scripts/verify-ssh-helper-artifact.ts --archive="${archives[0]}" --sandbox=required --report="dist-exe/ssh-helper/$HELPER_TARGET.json"
- name: Verify the packaged Landlock backend
if: runner.os == 'Linux'
env:
HELPER_TARGET: ${{ matrix.target }}
run: |
archives=(dist-exe/ssh-helper/*.tar.gz)
pnpm exec tsx scripts/verify-ssh-helper-artifact.ts --archive="${archives[0]}" --sandbox=required --backend=landlock-run --report="dist-exe/ssh-helper/$HELPER_TARGET.landlock.json"
- name: Verify OpenSSH on glibc 2.28 without Node
if: runner.os == 'Linux'
env:
HELPER_TARGET: ${{ matrix.target }}
run: |
archives=(dist-exe/ssh-helper/*.tar.gz)
test "${#archives[@]}" -eq 1
pnpm exec tsx scripts/verify-ssh-helper-ssh.ts --archive="${archives[0]}" --report="dist-exe/ssh-helper/$HELPER_TARGET.ssh.json"
- name: Upload verified archive and evidence
uses: actions/upload-artifact@v7
with:
name: ssh-helper-${{ matrix.target }}
path: dist-exe/ssh-helper/*
if-no-files-found: error
@@ -1,220 +0,0 @@
name: Build PR preview
# Every push to a pull request publishes that pull request's preview to
# Cloudflare Pages under its own branch alias, behind Cloudflare Access. The
# upload carries build products plus the snapshot diff page, which embeds
# committed `snapshots/` diff text: the workflow never grants the deployment
# platform access to this repository's sources. This lane also owns the
# aggregate test and script type checks that the required Linux consumers no
# longer repeat on every pull request.
on:
pull_request:
types: [opened, synchronize, reopened]
# Within one pull request the newest build wins. Across pull requests there is
# nothing to serialize: each uploads to its own branch alias, so two deployments
# never contend for the same URL.
concurrency:
group: build-preview-cloudflare-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
env:
PRIMARY_NODE_VERSION: '^24.22.3'
# Cloudflare Pages project receiving the upload. Its preview deployments are
# the surface the Access application protects; the project's production branch
# is deliberately a name no deployment uses, so no unprotected URL exists.
CF_PROJECT: dsh-build-preview
# CI runs must never report to the production telemetry endpoint baked into
# apps/cli/cordis.yml (AppCLIEntry disables the row when set).
DSH_TELEMETRY_DISABLED: '1'
jobs:
preview:
# The required outcome is the build, which runs four TypeScript programs
# (Host and Client package compilation, then each face's aggregate test and
# script check) after the Typert pass. Publishing is best effort: transport,
# Access, and comment failures warn instead of failing the check.
runs-on: >-
${{ vars.DSH_CI_FAILOVER_LINUX == 'blacksmith' && 'blacksmith-4vcpu-ubuntu-2404'
|| 'ubuntu-24.04' }}
name: cloudflare pages preview
steps:
# The pull_request checkout is the merge commit; depth 2 brings its first
# parent, the base branch tip, for the snapshot diff page.
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
fetch-depth: 2
- uses: pnpm/action-setup@v5.0.0
with:
dest: ${{ runner.temp }}/setup-pnpm
- uses: actions/setup-node@v7.0.0
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Configure pnpm store path
id: pnpm-store
run: |
store_root="$HOME/.local/share/pnpm/store"
echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
echo "path=$store_path" >> "$GITHUB_OUTPUT"
# Read-only: the preview lane consumes the default-branch cache without
# putting cache upload on its own path.
- uses: actions/cache/restore@v6.1.0
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
- name: Install (immutable)
run: pnpm install --frozen-lockfile
# apps/web consumes workspace packages as built lib products, and
# build:preview packs the image through the packer's installed bin
# (lib/bin.js), so neither half exists before the artifact build runs.
# The required Linux consumers emit artifacts only; the complete build
# here also runs the aggregate test and script checks, which share the
# Typert output and the two package compilations.
- name: Build workspace and check aggregate programs
run: pnpm run build
- name: Build the preview page and pack the VFS image
env:
DSH_CLIENT_TITLE: DSH preview pr-${{ github.event.pull_request.number }}
run: pnpm --filter @deepseek-ai/dsh-web-frontend run build:preview
# Sourcemaps carry complete sources and stay off the deployment platform.
# index.html is the served page, which cannot boot without a host
# injecting window.__DSH_BOOT__; replacing it with the worker page makes
# the deployment root the usable entry instead of a page that never boots.
- name: Shape the upload
run: |
find apps/web/dist -name '*.map' -delete
cp apps/web/dist/preview.html apps/web/dist/index.html
# Reviewers read snapshot changes at /snapshot-diff/, which opens on the
# SDK blank-Session catalog (system prompt and tool schemas); the source
# chooser links to it. The page serves review only, so a failure warns
# like publication instead of failing the build.
- name: Render the snapshot diff page
id: snapshot-diff
continue-on-error: true
run: >-
pnpm exec tsx scripts/snapshot-diff-page.ts --base HEAD^1 --head HEAD
--out apps/web/dist/snapshot-diff
--preview-manifest apps/web/dist/preview/fixtures.json
- name: Upload to Cloudflare Pages
id: upload
continue-on-error: true
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
npx --yes wrangler@4 pages deploy apps/web/dist \
--project-name "$CF_PROJECT" \
--branch "pr-${{ github.event.pull_request.number }}" \
--commit-dirty=true
# The image is what a worker boot fails on first and least visibly, so the
# run only passes once the protected URL serves it as gzip bytes. Three
# facts are asserted, each with its own failure meaning:
# 200 Access admitted the request; a 302 means the
# Access policy is missing its Service Auth rule
# for this token
# no content-encoding the platform did not claim transport
# compression, which would make the browser
# decode the body and leave the worker's
# DecompressionStream inflating a plain tar
# gzip magic 1f 8b the bytes really are the gzip member the
# packer wrote
# Accept-Encoding is sent because a browser sends it; the assertion is
# about what the platform does with a body that is already compressed.
- name: Verify the protected deployment serves the image
id: verify
continue-on-error: true
env:
CF_ACCESS_CLIENT_ID: ${{ secrets.CF_ACCESS_CLIENT_ID }}
CF_ACCESS_CLIENT_SECRET: ${{ secrets.CF_ACCESS_CLIENT_SECRET }}
run: |
url="https://pr-${{ github.event.pull_request.number }}.${CF_PROJECT}.pages.dev"
image="$url/preview/vfs-image.tar.gz"
code=000
for attempt in 1 2 3 4 5; do
code=$(curl -sS -o image.bin -D headers.txt -w '%{http_code}' \
-H 'Accept-Encoding: gzip' \
-H "CF-Access-Client-Id: $CF_ACCESS_CLIENT_ID" \
-H "CF-Access-Client-Secret: $CF_ACCESS_CLIENT_SECRET" \
"$image" || echo 000)
echo "attempt $attempt: HTTP $code"
if [ "$code" = "200" ]; then break; fi
sleep 10
done
if [ "$code" != "200" ]; then
echo "the protected image URL answered $code, not 200"
head -20 headers.txt
exit 1
fi
if grep -qi '^content-encoding:' headers.txt; then
echo "the platform declared transport compression on an already-compressed image:"
grep -i '^content-encoding:' headers.txt
exit 1
fi
magic=$(head -c 2 image.bin | od -An -tx1 | tr -d ' \n')
if [ "$magic" != "1f8b" ]; then
echo "image does not start with the gzip magic number: $magic"
exit 1
fi
echo "image served as $(wc -c < image.bin) gzip bytes"
# The alias URL follows from the pull request number, so it is stable
# across redeploys and worth stating once. The marker makes the comment
# idempotent: a pull request opened before this workflow existed never
# sees an `opened` event, and every later push must not restate the URL;
# an existing comment with older text is edited in place.
- name: Comment the preview URL
id: comment
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.number }}
SNAPSHOT_DIFF: ${{ steps.snapshot-diff.outcome }}
run: |
marker='<!-- dsh-preview-url -->'
url="https://pr-$PR.${CF_PROJECT}.pages.dev"
links="[Preview for #$PR]($url)"
if [ "$SNAPSHOT_DIFF" = success ]; then links="$links · [snapshot changes]($url/snapshot-diff/)"; fi
# The marker sits on its own line: markdown renders no link on a
# line that opens with a raw HTML comment.
body=$(printf '%s\n\n%s\n' "$marker" "$links (requires Cloudflare Access sign-in)")
existing=$(gh api "repos/$GITHUB_REPOSITORY/issues/$PR/comments" --paginate \
--jq "[.[] | select(.user.login == \"github-actions[bot]\" and (.body | contains(\"$marker\")))] | first // empty | [.id, .body] | @json")
if [ -z "$existing" ]; then
printf '%s' "$body" | gh pr comment "$PR" --body-file -
elif [ "$(jq -r '.[1]' <<< "$existing")" != "$body" ]; then
gh api -X PATCH "repos/$GITHUB_REPOSITORY/issues/comments/$(jq -r '.[0]' <<< "$existing")" -f body="$body" > /dev/null
else
echo "preview URL already commented"
fi
# Publishing stays outside the required verdict: a snapshot diff page,
# Cloudflare, Access, or comment failure warns, while a build failure
# still fails this check.
- name: Report preview publication failures
if: >-
steps.snapshot-diff.outcome == 'failure' || steps.upload.outcome == 'failure'
|| steps.verify.outcome == 'failure' || steps.comment.outcome == 'failure'
run: |
message='preview publication failed; the build passed, see the snapshot diff, upload, verify, and comment steps'
echo "::warning::$message"
echo "$message" >> "$GITHUB_STEP_SUMMARY"
@@ -1,109 +0,0 @@
name: Package CUA helper · macOS · arm64 + x64
on:
workflow_dispatch:
inputs:
preset:
description: '机器上的签名配置'
type: choice
options: [test, production]
default: test
required: true
workflow_call:
inputs:
reuse:
type: boolean
default: false
cua_macos_run_id:
type: string
default: ''
preset:
type: string
default: production
outputs:
artifact-id:
description: '包含两个架构的已签名、公证 helper 的产物编号'
value: ${{ jobs.package.outputs.artifact-id }}
run-id:
description: '产物所属的构建运行编号'
value: ${{ jobs.package.outputs.run-id }}
build-key:
description: '源码和构建配置的摘要'
value: ${{ jobs.package.outputs.build-key }}
permissions:
contents: read
actions: read
# Desktop uses the same keychain search list and optional system proxy transaction.
concurrency:
group: macos-desktop-package
cancel-in-progress: false
jobs:
package:
runs-on: [self-hosted, macOS, ARM64, dsh-mac-package-trial]
timeout-minutes: 60
outputs:
artifact-id: ${{ steps.retained.outputs.artifact-id || steps.upload.outputs.artifact-id }}
run-id: ${{ steps.retained.outputs.run-id || github.run_id }}
build-key: ${{ steps.build-inputs.outputs.build-key }}
env:
DSH_PACKAGING_PRESET: ${{ inputs.preset }}
DSH_TELEMETRY_DISABLED: '1'
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
clean: true
- name: Validate run ref and preset
run: |
node -e 'const fs=require("node:fs"); const ref=process.env.GITHUB_REF;
if(!ref || (!ref.startsWith("refs/heads/") && !ref.startsWith("refs/tags/"))) throw Error("Select a trusted repository branch or release tag");
const tag=ref.replace(/^refs\/tags\//, "");
if(tag.startsWith("dsh-v") && tag!=="dsh-v"+JSON.parse(fs.readFileSync("package.json","utf8")).version) throw Error("Release tag must match product version");
if(!["test","production"].includes(process.env.DSH_PACKAGING_PRESET)) throw Error("Invalid preset");'
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
package-manager-cache: false
- name: Record CUA helper build inputs
id: build-inputs
run: node scripts/cua-helper/build-inputs.ts
- name: Find reusable CUA helper
if: inputs.reuse
id: retained
env:
GH_TOKEN: ${{ github.token }}
CUA_MACOS_RUN_ID: ${{ inputs.cua_macos_run_id }}
CUA_BUILD_KEY: ${{ steps.build-inputs.outputs.build-key }}
run: node scripts/cua-helper/select-artifact.ts
- uses: pnpm/action-setup@v5.0.0
if: steps.retained.outputs.artifact-id == ''
with:
dest: ${{ runner.temp }}/setup-pnpm-cua-${{ github.run_id }}-${{ github.run_attempt }}
- name: Install locked dependencies
if: steps.retained.outputs.artifact-id == ''
run: pnpm install --frozen-lockfile --ignore-scripts --ignore-pnpmfile
- name: Build and verify notarized applications
if: steps.retained.outputs.artifact-id == ''
env:
CUA_EXPECTED_BUILD_KEY: ${{ steps.build-inputs.outputs.build-key }}
run: |
mkdir -p dist
node --import tsx/esm scripts/cua-helper/package.ts --out dist/cua-helper
- uses: actions/upload-artifact@v7.0.1
if: steps.retained.outputs.artifact-id == ''
id: upload
with:
name: cua-helper-macos-${{ github.run_id }}-${{ github.run_attempt }}-${{ steps.build-inputs.outputs.build-key }}
path: dist/cua-helper/*
if-no-files-found: error
compression-level: 0
retention-days: 14
- name: Record newly built artifact
if: steps.retained.outputs.artifact-id == ''
env:
CUA_ARTIFACT_ID: ${{ steps.upload.outputs.artifact-id }}
run: |
printf '已构建 CUA helper,run ID `%s`,artifact ID `%s`。\n' "$GITHUB_RUN_ID" "$CUA_ARTIFACT_ID" >> "$GITHUB_STEP_SUMMARY"
@@ -1,107 +0,0 @@
name: Package CUA helper · Windows · x64
on:
workflow_dispatch:
workflow_call:
outputs:
artifact-id:
description: '包含 win-x64 helper ZIP 的产物编号'
value: ${{ jobs.package.outputs.artifact-id }}
run-id:
description: '产物所属的构建运行编号'
value: ${{ jobs.package.outputs.run-id }}
build-key:
description: '提交 SHA、.NET SDK 版本和 win-x64 RID 的 SHA-256 摘要'
value: ${{ jobs.package.outputs.build-key }}
permissions:
contents: read
jobs:
package:
runs-on: windows-latest
timeout-minutes: 30
defaults:
run:
shell: pwsh
outputs:
artifact-id: ${{ steps.upload.outputs.artifact-id }}
run-id: ${{ github.run_id }}
build-key: ${{ steps.metadata.outputs.build-key }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: actions/setup-dotnet@v5.4.0
with:
dotnet-version: '10.0.x'
- name: Restore locked Windows helper and run protocol checks
run: |
dotnet restore packages/experimental/cua-windows/native/cua-windows.slnx --locked-mode
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
dotnet run --project packages/experimental/cua-windows/native/tests/Protocol.Tests.csproj --configuration Release --no-restore
- name: Publish Windows CUA helper
run: >-
dotnet publish packages/experimental/cua-windows/native/entry/CuaWindows.csproj
--configuration Release
--runtime win-x64
--self-contained true
--no-restore
--output dist/cua-helper-win-x64
# Standalone helper zip contract: flat root with cua-helper.json,
# dsh-cua-windows.exe, and its runtime files. Installed providers place
# the same payload under native/bin/win-x64.
- name: Add helper metadata
id: metadata
env:
GITHUB_SHA: ${{ github.sha }}
run: |
$ErrorActionPreference = 'Stop'
$directory = 'dist/cua-helper-win-x64'
$exe = Join-Path $directory 'dsh-cua-windows.exe'
if (-not (Test-Path $exe -PathType Leaf)) { throw "helper executable is missing: $exe" }
$version = (Get-Content package.json -Raw | ConvertFrom-Json).version
$commit = $env:GITHUB_SHA
$sdk = (& dotnet --version).Trim()
$keyBytes = [Text.Encoding]::UTF8.GetBytes("$commit`n$sdk`nwin-x64")
$buildKey = [Convert]::ToHexString([Security.Cryptography.SHA256]::HashData($keyBytes)).ToLowerInvariant()
$files = [ordered]@{}
Get-ChildItem $directory -Recurse -File | Sort-Object FullName | ForEach-Object {
$relative = [IO.Path]::GetRelativePath($directory, $_.FullName) -replace '\\', '/'
$files[$relative] = (Get-FileHash $_.FullName -Algorithm SHA256).Hash.ToLowerInvariant()
}
# sha256 is the executable alias of files[dsh-cua-windows.exe].
# signing is an enum: unsigned or authenticode.
$metadata = [ordered]@{
schemaVersion = 1
platform = 'windows'
buildKey = $buildKey
version = $version
commit = $commit
architecture = 'x64'
executable = 'dsh-cua-windows.exe'
sha256 = $files['dsh-cua-windows.exe']
signing = 'unsigned'
files = $files
}
$json = $metadata | ConvertTo-Json -Depth 5
Set-Content -Path (Join-Path $directory 'cua-helper.json') -Value "$json`n" -NoNewline -Encoding utf8NoBOM
Add-Content -Path $env:GITHUB_OUTPUT -Value "build-key=$buildKey`n" -NoNewline -Encoding utf8
- name: Archive publish output
run: |
$zipPath = 'dist/cua-helper-win-x64.zip'
Compress-Archive -Path dist/cua-helper-win-x64/* -DestinationPath $zipPath
$zip = [IO.Compression.ZipFile]::OpenRead((Resolve-Path $zipPath).Path)
try {
foreach ($name in 'dsh-cua-windows.exe', 'cua-helper.json') {
if (-not $zip.GetEntry($name)) { throw "Missing root entry in helper ZIP: $name" }
}
} finally { $zip.Dispose() }
- uses: actions/upload-artifact@v7.0.1
id: upload
with:
name: cua-helper-windows-${{ github.run_id }}-${{ github.run_attempt }}-${{ steps.metadata.outputs.build-key }}
path: dist/cua-helper-win-x64.zip
if-no-files-found: error
compression-level: 0
retention-days: 14
-264
View File
@@ -1,264 +0,0 @@
name: Publish Desktop · COS
run-name: Publish Desktop package ${{ inputs.package_run_id }} / attempt ${{ inputs.package_run_attempt || 'latest' }}
on:
workflow_dispatch:
inputs:
package_run_id:
description: '打包运行 ID:填写成功的 Package Desktop run ID;发布环境和 release ID 沿用原包'
type: string
required: true
staging_percentage:
description: '更新灰度比例:0–100 整数,默认 100;留空沿用包内值,作用于原包所属渠道'
type: string
required: false
default: '100'
upload_website:
description: '同时上传官网安装包并刷新缓存(仅 production);取消后仅执行版本与自动更新发布'
type: boolean
default: true
required: true
package_run_attempt:
description: '打包尝试次数:留空选择最新一次,且必须成功;失败时不会回退到旧包'
type: string
required: false
default: ''
permissions:
contents: read
actions: read
jobs:
route:
runs-on: ubuntu-latest
outputs:
selection: ${{ steps.route.outputs.selection }}
runner: ${{ steps.route.outputs.runner }}
steps:
- name: Require master for publication
run: node -e "if (process.env.GITHUB_REF !== 'refs/heads/master') throw new Error('Desktop publication must be dispatched from master')"
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Reject debugging packages before dependency installation
id: preflight
env:
GH_TOKEN: ${{ github.token }}
run: node apps/desktop-publisher/src/preflight-desktop-publish.mjs
- uses: pnpm/action-setup@v5.0.0
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- run: pnpm install --frozen-lockfile
- name: Resolve original package and machine
id: route
env:
GH_TOKEN: ${{ github.token }}
DESKTOP_PUBLISH_RUNNERS: ${{ vars.DESKTOP_PUBLISH_RUNNERS }}
DESKTOP_PACKAGE_ATTEMPT: ${{ steps.preflight.outputs.attempt }}
run: node --import tsx apps/desktop-publisher/src/resolve-desktop-publish-ci.ts
prepare:
needs: route
runs-on: [self-hosted, '${{ needs.route.outputs.runner }}']
timeout-minutes: 30
outputs:
route: ${{ steps.local.outputs.route }}
preset: ${{ steps.local.outputs.preset }}
approval: ${{ steps.check.outputs.approval }}
website-approval: ${{ steps.check.outputs.website-approval }}
website-destination: ${{ steps.check.outputs.website-destination }}
label: ${{ steps.check.outputs.label }}
env:
DESKTOP_STAGING_PERCENTAGE: ${{ inputs.staging_percentage }}
DESKTOP_PACKAGE_SELECTION: ${{ needs.route.outputs.selection }}
DESKTOP_UPLOAD_WEBSITE: ${{ inputs.upload_website }}
DSH_TELEMETRY_DISABLED: '1'
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
clean: false
path: desktop-publisher
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: desktop-publisher/package.json
dest: ${{ runner.temp }}/publish-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Check local publication configuration before dependency installation
working-directory: desktop-publisher
run: node apps/desktop-publisher/src/preflight-desktop-publish-local.mjs
- run: pnpm install --frozen-lockfile
working-directory: desktop-publisher
- name: Resolve retained package and approval environment
id: local
working-directory: desktop-publisher
env:
GH_TOKEN: ${{ github.token }}
run: node --import tsx apps/desktop-publisher/src/resolve-retained-desktop-publish-ci.ts
- name: Verify local package without upload credentials
id: check
working-directory: desktop-publisher
env:
DESKTOP_PUBLISH_ROUTE: ${{ steps.local.outputs.route }}
run: node --import tsx apps/desktop/scripts/publish-desktop-ci.ts --check
publish:
name: Approve ${{ needs.prepare.outputs.label }}
needs: [route, prepare]
runs-on: [self-hosted, '${{ needs.route.outputs.runner }}']
environment: ${{ needs.prepare.outputs.preset == 'production' && 'desktop-production' || 'desktop-test' }}
concurrency:
group: desktop-publish-${{ needs.route.outputs.runner }}-${{ needs.prepare.outputs.preset }}
cancel-in-progress: false
timeout-minutes: 90
env:
DESKTOP_STAGING_PERCENTAGE: ${{ inputs.staging_percentage }}
DESKTOP_APPROVED_PACKAGE: ${{ needs.prepare.outputs.approval }}
DESKTOP_PUBLISH_ROUTE: ${{ needs.prepare.outputs.route }}
DSH_TELEMETRY_DISABLED: '1'
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
clean: false
path: desktop-publisher
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: desktop-publisher/package.json
dest: ${{ runner.temp }}/publish-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Check local publication configuration before dependency installation
working-directory: desktop-publisher
run: node apps/desktop-publisher/src/preflight-desktop-publish-local.mjs
- run: pnpm install --frozen-lockfile
working-directory: desktop-publisher
- name: Verify local package without upload credentials
id: check
working-directory: desktop-publisher
run: node --import tsx apps/desktop/scripts/publish-desktop-ci.ts --check
- name: Read machine GitHub App key
if: needs.prepare.outputs.preset == 'production'
id: key
env:
APP_KEY_FILE: ${{ steps.check.outputs.app-key-file }}
working-directory: desktop-publisher
run: node apps/desktop/scripts/read-desktop-app-key.mjs
- name: Create short-lived tag token
if: needs.prepare.outputs.preset == 'production'
id: app
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1
with:
client-id: ${{ steps.check.outputs.app-client-id }}
private-key: ${{ steps.key.outputs.private-key }}
owner: ${{ github.repository_owner }}
repositories: ${{ github.event.repository.name }}
permission-contents: write
- name: Publish files, update feeds and record release tag
id: publish
working-directory: desktop-publisher
env:
DESKTOP_TAG_TOKEN: ${{ steps.app.outputs.token }}
run: node --import tsx apps/desktop/scripts/publish-desktop-ci.ts --publish
- name: Retain publication audit
continue-on-error: true
if: always() && steps.publish.outputs.record != ''
uses: actions/upload-artifact@v7.0.1
with:
name: desktop-publication-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ steps.publish.outputs.record }}/
if-no-files-found: error
retention-days: 30
upload-website-installer:
needs: [route, prepare, publish]
if: inputs.upload_website && needs.prepare.outputs.preset != 'test'
runs-on: [self-hosted, '${{ needs.route.outputs.runner }}']
environment: desktop-production
timeout-minutes: 60
concurrency:
group: desktop-website-upload-${{ needs.prepare.outputs.website-destination }}
cancel-in-progress: false
env:
DESKTOP_PUBLISH_ROUTE: ${{ needs.prepare.outputs.route }}
DESKTOP_WEBSITE_APPROVAL: ${{ needs.prepare.outputs.website-approval }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
clean: false
path: website-publisher
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: website-publisher/package.json
dest: ${{ runner.temp }}/website-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Check local publication configuration
working-directory: website-publisher
run: node apps/desktop-publisher/src/preflight-desktop-publish-local.mjs
- run: pnpm install --frozen-lockfile
working-directory: website-publisher
- name: Upload website installer
id: website
working-directory: website-publisher
run: node --import tsx apps/desktop-publisher/src/publish-website-ci.ts upload
- name: Archive website publication diagnostics
if: always() && steps.website.outputs.record != ''
continue-on-error: true
uses: actions/upload-artifact@v7.0.1
with:
name: website-upload-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ steps.website.outputs.record }}/
if-no-files-found: warn
retention-days: 30
purge-website-installer:
needs: [route, prepare, upload-website-installer]
if: inputs.upload_website && needs.prepare.outputs.preset != 'test'
runs-on: [self-hosted, '${{ needs.route.outputs.runner }}']
environment: desktop-production
timeout-minutes: 60
concurrency:
group: desktop-website-purge-${{ needs.prepare.outputs.website-destination }}
cancel-in-progress: false
env:
DESKTOP_PUBLISH_ROUTE: ${{ needs.prepare.outputs.route }}
DESKTOP_WEBSITE_APPROVAL: ${{ needs.prepare.outputs.website-approval }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
clean: false
path: website-publisher
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: website-publisher/package.json
dest: ${{ runner.temp }}/website-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Check local publication configuration
working-directory: website-publisher
run: node apps/desktop-publisher/src/preflight-desktop-publish-local.mjs
- run: pnpm install --frozen-lockfile
working-directory: website-publisher
- name: Recover and observe website cache purge
id: website
working-directory: website-publisher
run: node --import tsx apps/desktop-publisher/src/publish-website-ci.ts purge
- name: Archive website publication diagnostics
if: always() && steps.website.outputs.record != ''
continue-on-error: true
uses: actions/upload-artifact@v7.0.1
with:
name: website-purge-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ steps.website.outputs.record }}/
if-no-files-found: warn
retention-days: 30
-262
View File
@@ -1,262 +0,0 @@
name: Publish Desktop · Rollout & Website
run-name: Rollout Desktop package ${{ inputs.package_run_id }} / attempt ${{ inputs.package_run_attempt }} · ${{ inputs.rollout_percentage && format('{0}%', inputs.rollout_percentage) || 'website only' }}
on:
workflow_dispatch:
inputs:
package_run_id:
description: '已经完成首次 COS 发布的 Package Desktop run ID'
type: string
required: true
rollout_percentage:
description: '目标放量比例:0–100 整数,只允许保持或增加;留空只发布官网'
type: string
required: false
default: ''
upload_website:
description: '上传已发布版本的官网安装包并刷新缓存(仅 production,不要求放量达到 100%)'
type: boolean
default: false
required: true
package_run_attempt:
description: '已发布的原打包 attempt;默认 1,请核对原 run'
type: string
required: true
default: '1'
permissions:
contents: read
actions: read
jobs:
route:
runs-on: ubuntu-latest
outputs:
selection: ${{ steps.route.outputs.selection }}
runner: ${{ steps.route.outputs.runner }}
steps:
- name: Require master for publication
run: node -e "if (process.env.GITHUB_REF !== 'refs/heads/master') throw new Error('Desktop publication must be dispatched from master')"
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Reject debugging packages before dependency installation
id: preflight
env:
GH_TOKEN: ${{ github.token }}
run: node apps/desktop-publisher/src/preflight-desktop-publish.mjs
- uses: pnpm/action-setup@v5.0.0
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- run: pnpm --filter @deepseek-ai/dsh-desktop-publisher --fail-if-no-match install --prod --frozen-lockfile --ignore-scripts
- name: Resolve original package and machine
id: route
env:
GH_TOKEN: ${{ github.token }}
DESKTOP_PUBLISH_RUNNERS: ${{ vars.DESKTOP_PUBLISH_RUNNERS }}
DESKTOP_PACKAGE_ATTEMPT: ${{ steps.preflight.outputs.attempt }}
working-directory: apps/desktop-publisher
run: node --import tsx src/resolve-desktop-publish-ci.ts
prepare:
needs: route
runs-on: [self-hosted, '${{ needs.route.outputs.runner }}']
timeout-minutes: 30
outputs:
route: ${{ steps.local.outputs.route }}
preset: ${{ steps.local.outputs.preset }}
rollout-requested: ${{ steps.check.outputs.rollout-requested }}
approval: ${{ steps.check.outputs.approval }}
website-approval: ${{ steps.check.outputs.website-approval }}
website-destination: ${{ steps.check.outputs.website-destination }}
label: ${{ steps.check.outputs.label }}
env:
DESKTOP_ROLLOUT_PERCENTAGE: ${{ inputs.rollout_percentage }}
DESKTOP_PACKAGE_SELECTION: ${{ needs.route.outputs.selection }}
DESKTOP_UPLOAD_WEBSITE: ${{ inputs.upload_website }}
DSH_TELEMETRY_DISABLED: '1'
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
clean: false
path: desktop-rollout
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: desktop-rollout/package.json
dest: ${{ runner.temp }}/publish-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Check local publication configuration before dependency installation
working-directory: desktop-rollout
run: node apps/desktop-publisher/src/preflight-desktop-publish-local.mjs
- run: pnpm --filter @deepseek-ai/dsh-desktop-publisher --fail-if-no-match install --prod --frozen-lockfile --ignore-scripts
working-directory: desktop-rollout
- name: Resolve retained package and approval environment
id: local
working-directory: desktop-rollout/apps/desktop-publisher
env:
GH_TOKEN: ${{ github.token }}
run: node --import tsx src/publish-desktop-rollout-ci.ts route
- name: Verify initial publication and metadata without upload credentials
id: check
working-directory: desktop-rollout/apps/desktop-publisher
env:
DESKTOP_PUBLISH_ROUTE: ${{ steps.local.outputs.route }}
run: node --import tsx src/publish-desktop-rollout-ci.ts check
publish:
name: Approve ${{ needs.prepare.outputs.label }}
needs: [route, prepare]
if: needs.prepare.outputs.rollout-requested == 'true'
runs-on: [self-hosted, '${{ needs.route.outputs.runner }}']
environment: ${{ needs.prepare.outputs.preset == 'production' && 'desktop-production' || 'desktop-test' }}
concurrency:
group: desktop-publish-${{ needs.route.outputs.runner }}-${{ needs.prepare.outputs.preset }}
cancel-in-progress: false
timeout-minutes: 90
env:
DESKTOP_ROLLOUT_PERCENTAGE: ${{ inputs.rollout_percentage }}
DESKTOP_ROLLOUT_APPROVAL: ${{ needs.prepare.outputs.approval }}
DESKTOP_UPLOAD_WEBSITE: ${{ inputs.upload_website }}
DESKTOP_PUBLISH_ROUTE: ${{ needs.prepare.outputs.route }}
DSH_TELEMETRY_DISABLED: '1'
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
clean: false
path: desktop-rollout
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: desktop-rollout/package.json
dest: ${{ runner.temp }}/publish-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Check local publication configuration before dependency installation
working-directory: desktop-rollout
run: node apps/desktop-publisher/src/preflight-desktop-publish-local.mjs
- run: pnpm --filter @deepseek-ai/dsh-desktop-publisher --fail-if-no-match install --prod --frozen-lockfile --ignore-scripts
working-directory: desktop-rollout
- name: Verify initial publication and metadata without upload credentials
id: check
working-directory: desktop-rollout/apps/desktop-publisher
run: node --import tsx src/publish-desktop-rollout-ci.ts check
- name: Apply rollout to the published feed
id: publish
working-directory: desktop-rollout/apps/desktop-publisher
run: node --import tsx src/publish-desktop-rollout-ci.ts apply
- name: Retain publication audit
continue-on-error: true
if: always() && steps.publish.outputs.record != ''
uses: actions/upload-artifact@v7.0.1
with:
name: desktop-publication-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ steps.publish.outputs.record }}/
if-no-files-found: error
retention-days: 30
upload-website-installer:
name: Website ${{ needs.prepare.outputs.label }}
needs: [route, prepare, publish]
if: ${{ !cancelled() && inputs.upload_website && needs.prepare.result == 'success' && needs.prepare.outputs.preset != 'test' && (needs.publish.result == 'success' || (needs.publish.result == 'skipped' && needs.prepare.outputs.rollout-requested == 'false')) }}
runs-on: [self-hosted, '${{ needs.route.outputs.runner }}']
environment: desktop-production
timeout-minutes: 60
concurrency:
group: desktop-website-upload-${{ needs.prepare.outputs.website-destination }}
cancel-in-progress: false
env:
DESKTOP_PUBLISH_ROUTE: ${{ needs.prepare.outputs.route }}
DESKTOP_WEBSITE_APPROVAL: ${{ needs.prepare.outputs.website-approval }}
DESKTOP_ROLLOUT_APPROVAL: ${{ needs.prepare.outputs.approval }}
DESKTOP_ROLLOUT_PERCENTAGE: ${{ inputs.rollout_percentage }}
DESKTOP_UPLOAD_WEBSITE: ${{ inputs.upload_website }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
clean: false
path: website-rollout
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: website-rollout/package.json
dest: ${{ runner.temp }}/website-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Check local publication configuration
working-directory: website-rollout
run: node apps/desktop-publisher/src/preflight-desktop-publish-local.mjs
- run: pnpm --filter @deepseek-ai/dsh-desktop-publisher --fail-if-no-match install --prod --frozen-lockfile --ignore-scripts
working-directory: website-rollout
- name: Upload website installer
id: website
working-directory: website-rollout/apps/desktop-publisher
run: node --import tsx src/publish-desktop-rollout-ci.ts website-upload
- name: Archive website feed verification
if: always() && steps.website.outputs.rollout-record != ''
continue-on-error: true
uses: actions/upload-artifact@v7.0.1
with:
name: website-feed-verification-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ steps.website.outputs.rollout-record }}/
if-no-files-found: warn
retention-days: 30
- name: Archive website publication diagnostics
if: always() && steps.website.outputs.record != ''
continue-on-error: true
uses: actions/upload-artifact@v7.0.1
with:
name: website-upload-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ steps.website.outputs.record }}/
if-no-files-found: warn
retention-days: 30
purge-website-installer:
needs: [route, prepare, upload-website-installer]
if: ${{ !cancelled() && inputs.upload_website && needs.prepare.outputs.preset != 'test' && needs.upload-website-installer.result == 'success' }}
runs-on: [self-hosted, '${{ needs.route.outputs.runner }}']
timeout-minutes: 60
concurrency:
group: desktop-website-purge-${{ needs.prepare.outputs.website-destination }}
cancel-in-progress: false
env:
DESKTOP_PUBLISH_ROUTE: ${{ needs.prepare.outputs.route }}
DESKTOP_WEBSITE_APPROVAL: ${{ needs.prepare.outputs.website-approval }}
DESKTOP_UPLOAD_WEBSITE: ${{ inputs.upload_website }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
clean: false
path: website-rollout
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: website-rollout/package.json
dest: ${{ runner.temp }}/website-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Check local publication configuration
working-directory: website-rollout
run: node apps/desktop-publisher/src/preflight-desktop-publish-local.mjs
- run: pnpm --filter @deepseek-ai/dsh-desktop-publisher --fail-if-no-match install --prod --frozen-lockfile --ignore-scripts
working-directory: website-rollout
- name: Recover and observe website cache purge
id: website
working-directory: website-rollout/apps/desktop-publisher
run: node --import tsx src/publish-desktop-rollout-ci.ts website-purge
- name: Archive website publication diagnostics
if: always() && steps.website.outputs.record != ''
continue-on-error: true
uses: actions/upload-artifact@v7.0.1
with:
name: website-purge-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ steps.website.outputs.record }}/
if-no-files-found: warn
retention-days: 30
-93
View File
@@ -1,93 +0,0 @@
# Publish the documentation website to GitHub Pages. This workflow is manual-only
# (workflow_dispatch) and intentionally does not listen to pull_request or push:
# the site presents a released snapshot, so publication is an explicit act from a
# dsh-v* tag and must never appear as a PR check. `release:verify` rejects every
# other ref, and the github-pages environment repeats that restriction as a
# deployment tag policy with required reviewers.
#
# The build signal does not depend on this workflow. Every pull request builds
# the production site through `check:ci:static`, and ci-master.yml builds it
# again on master.
name: Deploy documentation
on:
workflow_dispatch:
concurrency:
group: github-pages
cancel-in-progress: false
permissions:
contents: read
env:
PRIMARY_NODE_VERSION: '^24.22.3'
# Projected source links target the public repository, whose history can
# differ from this workflow's source repository. This stays on master rather
# than following the dispatched tag: that repository advances only to each
# release commit, so its master never carries unreleased work, and it retains
# only the most recent tags — following the tag would leave every projected
# source link on an older deploy unresolvable.
DOCS_REPOSITORY_REF: master
# CI runs must never report to the production telemetry endpoint baked
# into apps/cli/cordis.yml (AppCLIEntry disables the row when set).
DSH_TELEMETRY_DISABLED: '1'
jobs:
build:
runs-on: blacksmith-8vcpu-ubuntu-2404
permissions:
contents: read
pages: read
steps:
# Complete history: the release scripts read tags.
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: pnpm/action-setup@v5.0.0
- uses: actions/setup-node@v7.0.0
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
cache: pnpm
- name: Install (immutable)
run: pnpm install --frozen-lockfile
# One definition of "released" for the site and the npm sequence: this
# rejects every ref that is not a dsh-v* tag naming the version this tree
# carries.
- name: Verify release version
env:
RELEASE_PUBLISH: 'true'
run: pnpm run release:verify --family dsh
- name: Configure Pages
id: pages
uses: actions/configure-pages@v6
- name: Verify and build documentation
env:
DOCS_BASE: ${{ steps.pages.outputs.base_path }}/
run: pnpm run doc-sync
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: website/.dist
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
-247
View File
@@ -1,247 +0,0 @@
name: Package Desktop · macOS · Intel
on:
workflow_dispatch:
inputs:
source_ref:
description: '打包源码:test 支持仓库内分支或 dsh-v* tag;production 仅支持 master 或 dsh-v* tag;源码须包含 CI 适配脚本'
type: string
default: master
required: true
preset:
description: '打包环境:选择机器上的 test 或 production 配置;同时决定后续发布环境'
type: choice
options: [test, production]
default: test
required: true
update_channel:
description: '升级通道:人工选择 nightly 或 stable,与版本后缀无关;默认通道由此打包输入确定'
type: choice
options: [nightly, stable]
default: nightly
required: true
version_mode:
description: '版本模式:default 按环境自动选择(test 取 build-number,production 取 follow-dsh);follow-dsh 跟随 dsh 包版本号;build-number 自动追加构建编号;manual 手填'
type: choice
options: [default, follow-dsh, build-number, manual]
default: default
required: true
build_version:
description: '手动版本号:仅 manual 时填写完整版本;须为产品原版本或受支持的预发布后缀'
type: string
default: ''
required: false
test_release_id:
description: '测试 release ID:32 位小写十六进制随机前缀(非鉴权);留空使用机器默认值,连续升级测试须保持相同值'
type: string
default: ''
required: false
compression_level:
description: 'ZIP 压缩等级:只影响 ZIP 和自动升级下载,不影响 DMG;3 打包较快,7 压缩更强'
type: choice
options: ['3', '7']
default: '3'
required: true
skip_notarization:
description: '跳过公证和 stapling:仅限内部调试,禁止发布到 test / production 或用于自动更新;需要发布请勿勾选'
type: boolean
default: false
required: true
permissions:
contents: read
concurrency:
group: macos-desktop-package
cancel-in-progress: false
jobs:
package:
outputs:
directory: ${{ steps.retained.outputs.directory }}
runner: ${{ steps.retained.outputs.runner }}
runner-name: ${{ steps.retained.outputs.runner-name }}
attempt: ${{ steps.retained.outputs.attempt }}
version: ${{ steps.settings.outputs.version }}
mode: ${{ steps.settings.outputs.mode }}
runs-on: [self-hosted, macOS, ARM64, dsh-mac-package-trial]
timeout-minutes: 180
defaults:
run:
shell: bash
env:
DSH_DESKTOP_TARGET_PLATFORM: darwin
DSH_DESKTOP_TARGET_ARCH: x64
PACKAGE_MACOS_ZIP_COMPRESSION_LEVEL: ${{ inputs.compression_level }}
PACKAGE_SKIP_NOTARIZATION: ${{ inputs.skip_notarization }}
PACKAGE_SOURCE_REF: ${{ inputs.source_ref }}
# TODO: Remove this legacy source_ref mode mapping on 2027-01-04 with the parser aliases.
PACKAGE_VERSION_MODE: ${{ inputs.version_mode == 'follow-dsh' && 'product' || inputs.version_mode == 'build-number' && 'auto' || inputs.version_mode }}
DSH_DESKTOP_UPDATE_CHANNEL: ${{ inputs.update_channel }}
DSH_TELEMETRY_DISABLED: '1'
DSH_PACKAGING_PRESET: ${{ inputs.preset }}
PACKAGE_TEST_RELEASE_ID: ${{ inputs.test_release_id }}
steps:
- uses: actions/checkout@v7.0.1
id: checkout
with:
persist-credentials: false
clean: true
ref: ${{ inputs.source_ref }}
- name: Validate selected source and adapter support
run: >-
node -e "const fs=require('node:fs'); const ref=process.env.PACKAGE_SOURCE_REF;
const cp=require('node:child_process'); const preset=process.env.DSH_PACKAGING_PRESET;
if(!['test','production'].includes(preset)) throw Error('Unknown packaging preset');
const tag=/^dsh-v[0-9][0-9A-Za-z.-]*$/.test(ref);
if(preset==='production' && ref!=='master' && !tag) throw Error('Production source must be master or dsh-v*');
if(tag) {
const v=JSON.parse(fs.readFileSync('package.json','utf8')).version;
if(ref!=='dsh-v'+v) throw Error('Source tag must match product version');
const tagged=cp.execFileSync('git',['rev-parse','--verify','refs/tags/'+ref+'^{commit}'],{encoding:'utf8'}).trim();
const head=cp.execFileSync('git',['rev-parse','HEAD'],{encoding:'utf8'}).trim();
if(tagged!==head) throw Error('Checkout does not match source tag');
} else {
const branch=cp.execFileSync('git',['rev-parse','--abbrev-ref','HEAD'],{encoding:'utf8'}).trim();
if(branch==='HEAD' || branch!==ref || ref.startsWith('refs/')) throw Error('Select a branch in this repository, not a SHA or PR ref');
}
if(!fs.readFileSync('apps/desktop/scripts/prepare-macos-ci.mjs','utf8').includes('resolveDesktopBuildTarget')) throw Error('Source lacks Intel macOS CI support; select a newer source');
if(!fs.readFileSync('apps/desktop/scripts/retain-desktop-ci.ts','utf8').includes('--check-runner')) throw Error('Source lacks independent Desktop artifact archival support; select a newer source');
if(!fs.readFileSync('apps/desktop/scripts/desktop-ci-version.mjs','utf8').includes('PACKAGE_VERSION_MODE')) throw Error('Source lacks Desktop channel/version CI support; select a newer release');"
- uses: pnpm/action-setup@v5.0.0
with:
dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Configure persistent package caches
env:
DSH_DESKTOP_PACKAGE_CACHE_DIR: ${{ runner.tool_cache }}/dsh-desktop-package-cache
run: |
echo "DSH_DESKTOP_PACKAGE_CACHE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR" >> "$GITHUB_ENV"
echo "PNPM_CONFIG_STORE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR/workspace-pnpm-store" >> "$GITHUB_ENV"
- name: Check Rosetta execution
run: arch -x86_64 /usr/bin/true
- name: Install locked dependencies
run: pnpm install --frozen-lockfile
- name: Check original machine archival route
env:
DESKTOP_PUBLISH_RUNNERS: ${{ vars.DESKTOP_PUBLISH_RUNNERS }}
run: node --import tsx apps/desktop/scripts/retain-desktop-ci.ts --check-runner
- name: Validate preset and resolve build version
id: settings
env:
PACKAGE_BUILD_VERSION: ${{ inputs.build_version }}
run: node apps/desktop/scripts/prepare-macos-ci.mjs
- name: Check packaging configuration and toolchain
env:
PACKAGE_VERSION: ${{ steps.settings.outputs.version }}
run: |
args=()
if [[ "$PACKAGE_SKIP_NOTARIZATION" = true ]]; then args+=(--skip-notarization); fi
pnpm run package:desktop:mac:x64 --check --build-version "$PACKAGE_VERSION" "${args[@]}"
- name: Build and stage notarized Computer Use helpers
# A source whose dsh ships the Computer Use bundle packs the workspace provider into the Desktop runtime,
# which therefore needs the same notarized helper npm publication stages.
run: |
if ! node -e "process.exit(require('./apps/cli/package.json').dependencies?.['@deepseek-ai/dsh-cua-bundle'] ? 0 : 1)"; then
echo 'This source does not ship Computer Use in Desktop; no helper is staged.'
exit 0
fi
if [[ ! -f scripts/cua-helper/package.ts ]]; then
echo '::warning::This source ships Computer Use but predates helper packaging; Computer Use cannot prepare its helper in this package.'
exit 0
fi
mkdir -p dist
pnpm exec tsx scripts/cua-helper/package.ts --out dist/cua-helper
mkdir dist/cua-helper/extracted
tar -xzf dist/cua-helper/cua-helper.tgz -C dist/cua-helper/extracted
pnpm exec tsx scripts/cua-helper/stage.ts --from dist/cua-helper/extracted
- name: Build signed installers
env:
PACKAGE_VERSION: ${{ steps.settings.outputs.version }}
run: |
args=()
if [[ "$PACKAGE_SKIP_NOTARIZATION" = true ]]; then args+=(--skip-notarization); fi
pnpm run package:desktop:mac:x64 --build-version "$PACKAGE_VERSION" "${args[@]}"
- name: Retain complete package outside the checkout
id: retained
env:
DESKTOP_PUBLISH_RUNNERS: ${{ vars.DESKTOP_PUBLISH_RUNNERS }}
PACKAGE_SOURCE_SHA: ${{ steps.checkout.outputs.commit }}
PACKAGE_VERSION: ${{ steps.settings.outputs.version }}
run: node --import tsx apps/desktop/scripts/retain-desktop-ci.ts
- name: Retain packaging diagnostics
continue-on-error: true
if: always() && steps.checkout.outcome == 'success'
uses: actions/upload-artifact@v7.0.1
with:
name: macos-x64-package-logs-${{ github.run_id }}-${{ github.run_attempt }}
include-hidden-files: true
path: apps/desktop/.desktop-build/packaging-runs/
if-no-files-found: warn
retention-days: 14
upload-artifact:
needs: package
runs-on: [self-hosted, '${{ needs.package.outputs.runner }}']
timeout-minutes: 30
env:
DESKTOP_RETAINED_DIRECTORY: ${{ needs.package.outputs.directory }}
DESKTOP_ARCHIVE_NAME: macos-x64-${{ needs.package.outputs.mode }}-${{ needs.package.outputs.version }}-${{ github.run_id }}-${{ needs.package.outputs.attempt }}.zip
DESKTOP_PACKAGE_ATTEMPT: ${{ needs.package.outputs.attempt }}
DESKTOP_PACKAGE_RUNNER: ${{ needs.package.outputs.runner-name }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
path: artifact-archiver
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: artifact-archiver/package.json
dest: ${{ runner.temp }}/archive-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Configure persistent package caches
env:
DSH_DESKTOP_PACKAGE_CACHE_DIR: ${{ runner.tool_cache }}/dsh-desktop-package-cache
run: |
echo "DSH_DESKTOP_PACKAGE_CACHE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR" >> "$GITHUB_ENV"
echo "PNPM_CONFIG_STORE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR/workspace-pnpm-store" >> "$GITHUB_ENV"
- run: pnpm install --frozen-lockfile
working-directory: artifact-archiver
- name: Archive verified retained build
id: archive
working-directory: artifact-archiver
run: node --import tsx apps/desktop/scripts/archive-desktop-ci.ts --split-macos
- name: Retain DMG installer
if: ${{ !cancelled() && steps.archive.outcome == 'success' }}
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ steps.archive.outputs.dmg-name }}
path: ${{ steps.archive.outputs.dmg-path }}
archive: false
if-no-files-found: error
retention-days: 14
overwrite: true
- name: Retain update ZIP
if: ${{ !cancelled() && steps.archive.outcome == 'success' }}
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ steps.archive.outputs.update-name }}
path: ${{ steps.archive.outputs.update-path }}
archive: false
if-no-files-found: error
retention-days: 14
overwrite: true
- name: Retain package metadata
if: ${{ !cancelled() && steps.archive.outcome == 'success' }}
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ steps.archive.outputs.metadata-name }}
path: ${{ steps.archive.outputs.metadata-path }}
archive: false
if-no-files-found: error
retention-days: 14
overwrite: true
-244
View File
@@ -1,244 +0,0 @@
name: Package Desktop · macOS · Apple Silicon
on:
workflow_dispatch:
inputs:
source_ref:
description: '打包源码:test 支持仓库内分支或 dsh-v* tag;production 仅支持 master 或 dsh-v* tag;源码须包含 CI 适配脚本'
type: string
default: master
required: true
preset:
description: '打包环境:选择机器上的 test 或 production 配置;同时决定后续发布环境'
type: choice
options: [test, production]
default: test
required: true
update_channel:
description: '升级通道:人工选择 nightly 或 stable,与版本后缀无关;默认通道由此打包输入确定'
type: choice
options: [nightly, stable]
default: nightly
required: true
version_mode:
description: '版本模式:default 按环境自动选择(test 取 build-number,production 取 follow-dsh);follow-dsh 跟随 dsh 包版本号;build-number 自动追加构建编号;manual 手填'
type: choice
options: [default, follow-dsh, build-number, manual]
default: default
required: true
build_version:
description: '手动版本号:仅 manual 时填写完整版本;须为产品原版本或受支持的预发布后缀'
type: string
default: ''
required: false
test_release_id:
description: '测试 release ID:32 位小写十六进制随机前缀(非鉴权);留空使用机器默认值,连续升级测试须保持相同值'
type: string
default: ''
required: false
compression_level:
description: 'ZIP 压缩等级:只影响 ZIP 和自动升级下载,不影响 DMG;3 打包较快,7 压缩更强'
type: choice
options: ['3', '7']
default: '3'
required: true
skip_notarization:
description: '跳过公证和 stapling:仅限内部调试,禁止发布到 test / production 或用于自动更新;需要发布请勿勾选'
type: boolean
default: false
required: true
permissions:
contents: read
concurrency:
group: macos-desktop-package
cancel-in-progress: false
jobs:
package:
outputs:
directory: ${{ steps.retained.outputs.directory }}
runner: ${{ steps.retained.outputs.runner }}
runner-name: ${{ steps.retained.outputs.runner-name }}
attempt: ${{ steps.retained.outputs.attempt }}
version: ${{ steps.settings.outputs.version }}
mode: ${{ steps.settings.outputs.mode }}
runs-on: [self-hosted, macOS, ARM64, dsh-mac-package-trial]
timeout-minutes: 180
defaults:
run:
shell: bash
env:
DSH_DESKTOP_TARGET_PLATFORM: darwin
DSH_DESKTOP_TARGET_ARCH: arm64
PACKAGE_MACOS_ZIP_COMPRESSION_LEVEL: ${{ inputs.compression_level }}
PACKAGE_SKIP_NOTARIZATION: ${{ inputs.skip_notarization }}
PACKAGE_SOURCE_REF: ${{ inputs.source_ref }}
# TODO: Remove this legacy source_ref mode mapping on 2027-01-04 with the parser aliases.
PACKAGE_VERSION_MODE: ${{ inputs.version_mode == 'follow-dsh' && 'product' || inputs.version_mode == 'build-number' && 'auto' || inputs.version_mode }}
DSH_DESKTOP_UPDATE_CHANNEL: ${{ inputs.update_channel }}
DSH_TELEMETRY_DISABLED: '1'
DSH_PACKAGING_PRESET: ${{ inputs.preset }}
PACKAGE_TEST_RELEASE_ID: ${{ inputs.test_release_id }}
steps:
- uses: actions/checkout@v7.0.1
id: checkout
with:
persist-credentials: false
clean: true
ref: ${{ inputs.source_ref }}
- name: Validate selected source and adapter support
run: >-
node -e "const fs=require('node:fs'); const ref=process.env.PACKAGE_SOURCE_REF;
const cp=require('node:child_process'); const preset=process.env.DSH_PACKAGING_PRESET;
if(!['test','production'].includes(preset)) throw Error('Unknown packaging preset');
const tag=/^dsh-v[0-9][0-9A-Za-z.-]*$/.test(ref);
if(preset==='production' && ref!=='master' && !tag) throw Error('Production source must be master or dsh-v*');
if(tag) {
const v=JSON.parse(fs.readFileSync('package.json','utf8')).version;
if(ref!=='dsh-v'+v) throw Error('Source tag must match product version');
const tagged=cp.execFileSync('git',['rev-parse','--verify','refs/tags/'+ref+'^{commit}'],{encoding:'utf8'}).trim();
const head=cp.execFileSync('git',['rev-parse','HEAD'],{encoding:'utf8'}).trim();
if(tagged!==head) throw Error('Checkout does not match source tag');
} else {
const branch=cp.execFileSync('git',['rev-parse','--abbrev-ref','HEAD'],{encoding:'utf8'}).trim();
if(branch==='HEAD' || branch!==ref || ref.startsWith('refs/')) throw Error('Select a branch in this repository, not a SHA or PR ref');
}
if(!fs.readFileSync('apps/desktop/scripts/retain-desktop-ci.ts','utf8').includes('--check-runner')) throw Error('Source lacks independent Desktop artifact archival support; select a newer source');
if(!fs.readFileSync('apps/desktop/scripts/desktop-ci-version.mjs','utf8').includes('PACKAGE_VERSION_MODE')) throw Error('Source lacks Desktop channel/version CI support; select a newer release');"
- uses: pnpm/action-setup@v5.0.0
with:
dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Configure persistent package caches
env:
DSH_DESKTOP_PACKAGE_CACHE_DIR: ${{ runner.tool_cache }}/dsh-desktop-package-cache
run: |
echo "DSH_DESKTOP_PACKAGE_CACHE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR" >> "$GITHUB_ENV"
echo "PNPM_CONFIG_STORE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR/workspace-pnpm-store" >> "$GITHUB_ENV"
- name: Install locked dependencies
run: pnpm install --frozen-lockfile
- name: Check original machine archival route
env:
DESKTOP_PUBLISH_RUNNERS: ${{ vars.DESKTOP_PUBLISH_RUNNERS }}
run: node --import tsx apps/desktop/scripts/retain-desktop-ci.ts --check-runner
- name: Validate preset and resolve build version
id: settings
env:
PACKAGE_BUILD_VERSION: ${{ inputs.build_version }}
run: node apps/desktop/scripts/prepare-macos-ci.mjs
- name: Check packaging configuration and toolchain
env:
PACKAGE_VERSION: ${{ steps.settings.outputs.version }}
run: |
args=()
if [[ "$PACKAGE_SKIP_NOTARIZATION" = true ]]; then args+=(--skip-notarization); fi
pnpm run package:desktop:mac:arm64 --check --build-version "$PACKAGE_VERSION" "${args[@]}"
- name: Build and stage notarized Computer Use helpers
# A source whose dsh ships the Computer Use bundle packs the workspace provider into the Desktop runtime,
# which therefore needs the same notarized helper npm publication stages.
run: |
if ! node -e "process.exit(require('./apps/cli/package.json').dependencies?.['@deepseek-ai/dsh-cua-bundle'] ? 0 : 1)"; then
echo 'This source does not ship Computer Use in Desktop; no helper is staged.'
exit 0
fi
if [[ ! -f scripts/cua-helper/package.ts ]]; then
echo '::warning::This source ships Computer Use but predates helper packaging; Computer Use cannot prepare its helper in this package.'
exit 0
fi
mkdir -p dist
pnpm exec tsx scripts/cua-helper/package.ts --out dist/cua-helper
mkdir dist/cua-helper/extracted
tar -xzf dist/cua-helper/cua-helper.tgz -C dist/cua-helper/extracted
pnpm exec tsx scripts/cua-helper/stage.ts --from dist/cua-helper/extracted
- name: Build signed installers
env:
PACKAGE_VERSION: ${{ steps.settings.outputs.version }}
run: |
args=()
if [[ "$PACKAGE_SKIP_NOTARIZATION" = true ]]; then args+=(--skip-notarization); fi
pnpm run package:desktop:mac:arm64 --build-version "$PACKAGE_VERSION" "${args[@]}"
- name: Retain complete package outside the checkout
id: retained
env:
DESKTOP_PUBLISH_RUNNERS: ${{ vars.DESKTOP_PUBLISH_RUNNERS }}
PACKAGE_SOURCE_SHA: ${{ steps.checkout.outputs.commit }}
PACKAGE_VERSION: ${{ steps.settings.outputs.version }}
run: node --import tsx apps/desktop/scripts/retain-desktop-ci.ts
- name: Retain packaging diagnostics
continue-on-error: true
if: always() && steps.checkout.outcome == 'success'
uses: actions/upload-artifact@v7.0.1
with:
name: macos-package-logs-${{ github.run_id }}-${{ github.run_attempt }}
include-hidden-files: true
path: apps/desktop/.desktop-build/packaging-runs/
if-no-files-found: warn
retention-days: 14
upload-artifact:
needs: package
runs-on: [self-hosted, '${{ needs.package.outputs.runner }}']
timeout-minutes: 30
env:
DESKTOP_RETAINED_DIRECTORY: ${{ needs.package.outputs.directory }}
DESKTOP_ARCHIVE_NAME: macos-arm64-${{ needs.package.outputs.mode }}-${{ needs.package.outputs.version }}-${{ github.run_id }}-${{ needs.package.outputs.attempt }}.zip
DESKTOP_PACKAGE_ATTEMPT: ${{ needs.package.outputs.attempt }}
DESKTOP_PACKAGE_RUNNER: ${{ needs.package.outputs.runner-name }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
path: artifact-archiver
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: artifact-archiver/package.json
dest: ${{ runner.temp }}/archive-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Configure persistent package caches
env:
DSH_DESKTOP_PACKAGE_CACHE_DIR: ${{ runner.tool_cache }}/dsh-desktop-package-cache
run: |
echo "DSH_DESKTOP_PACKAGE_CACHE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR" >> "$GITHUB_ENV"
echo "PNPM_CONFIG_STORE_DIR=$DSH_DESKTOP_PACKAGE_CACHE_DIR/workspace-pnpm-store" >> "$GITHUB_ENV"
- run: pnpm install --frozen-lockfile
working-directory: artifact-archiver
- name: Archive verified retained build
id: archive
working-directory: artifact-archiver
run: node --import tsx apps/desktop/scripts/archive-desktop-ci.ts --split-macos
- name: Retain DMG installer
if: ${{ !cancelled() && steps.archive.outcome == 'success' }}
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ steps.archive.outputs.dmg-name }}
path: ${{ steps.archive.outputs.dmg-path }}
archive: false
if-no-files-found: error
retention-days: 14
overwrite: true
- name: Retain update ZIP
if: ${{ !cancelled() && steps.archive.outcome == 'success' }}
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ steps.archive.outputs.update-name }}
path: ${{ steps.archive.outputs.update-path }}
archive: false
if-no-files-found: error
retention-days: 14
overwrite: true
- name: Retain package metadata
if: ${{ !cancelled() && steps.archive.outcome == 'success' }}
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ steps.archive.outputs.metadata-name }}
path: ${{ steps.archive.outputs.metadata-path }}
archive: false
if-no-files-found: error
retention-days: 14
overwrite: true
@@ -1,188 +0,0 @@
# Build and publish the @deepseek-ai/node-addon-system package family from the
# harness source of record. Rehearsal and publication consume the same packed
# tarballs; each native binary is built on its matching architecture.
name: Node Addon System Release
on:
workflow_dispatch:
inputs:
publish:
description: Publish packed tarballs to npm. Must run from a node-addon-system-v* tag.
required: true
type: boolean
default: false
permissions:
contents: read
concurrency:
# Stable/prerelease dist-tags are shared registry state; serialize release
# runs so two versions cannot race the final tag assignment.
group: ${{ github.workflow }}
cancel-in-progress: false
defaults:
run:
working-directory: native/system
jobs:
matrix:
name: Matrix
runs-on: ubuntu-24.04
outputs:
prebuilds: ${{ steps.matrix.outputs.prebuilds }}
steps:
- uses: actions/checkout@v7.0.1
- id: matrix
run: echo "prebuilds=$(node ./scripts/github-matrix.mjs release-prebuild)" >> "$GITHUB_OUTPUT"
build-prebuilds:
name: ${{ matrix.package }}
needs: matrix
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.prebuilds) }}
steps:
- uses: actions/checkout@v7.0.1
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: package.json
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --filter @deepseek-ai/node-addon-system-workspace... --frozen-lockfile
- name: Install musl toolchain
if: runner.os == 'Linux'
run: |
sudo apt-get update -q
sudo apt-get install -yq musl-tools
- name: Build native binaries
run: pnpm build:native
- name: Verify binary metadata
run: node ./scripts/verify-launcher-binary.mjs ${{ matrix.dir }}
- name: Verify the built entry and flock
run: |
pnpm build:ts
pnpm build:test-oracle
pnpm test:flock
pnpm test:packaging
- name: Upload prebuild artifact
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ matrix.artifact }}
path: native/system/${{ matrix.dir }}/bin/**
if-no-files-found: error
retention-days: 7
pack:
name: Pack npm tarballs
needs: build-prebuilds
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7.0.1
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: package.json
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --filter @deepseek-ai/node-addon-system-workspace... --frozen-lockfile
- name: Build TypeScript
run: pnpm build:ts
- name: Verify release version
run: node ./scripts/verify-release.mjs
env:
RELEASE_PUBLISH: ${{ inputs.publish }}
- name: Download prebuild artifacts
uses: actions/download-artifact@v8.0.1
with:
pattern: prebuild-*
path: native/system/.release/prebuild-artifacts
- name: Assemble and verify prebuilds
run: node ./scripts/assemble-prebuilds.mjs .release/prebuild-artifacts
- name: Verify release payload
run: node ./scripts/verify-release.mjs --prebuilds
env:
RELEASE_PUBLISH: ${{ inputs.publish }}
- name: Pack release tarballs
run: node ./scripts/pack-release.mjs dist/npm
- name: Verify packed install
run: node ./scripts/verify-packed-install.mjs dist/npm
env:
NALR_REQUIRE_LANDLOCK: 1
- name: Upload npm tarballs
uses: actions/upload-artifact@v7.0.1
with:
name: npm-tarballs
path: native/system/dist/npm/*
if-no-files-found: error
retention-days: 7
publish:
name: Publish to npm
if: inputs.publish
needs: pack
runs-on: ubuntu-24.04
environment: npm-publish
permissions:
contents: read
id-token: write
steps:
# The publish script is the only repository file this job needs, and it
# imports nothing outside Node's builtins, so there is no install step.
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
registry-url: https://registry.npmjs.org
- name: Download npm tarballs
uses: actions/download-artifact@v8.0.1
with:
name: npm-tarballs
path: native/system/dist/npm
- name: Configure npm token fallback
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [[ -n "$NPM_TOKEN" ]]; then
echo "NODE_AUTH_TOKEN=$NPM_TOKEN" >> "$GITHUB_ENV"
fi
- name: Publish tarballs
# Publication is decided per package against the registry, so re-running
# this job over the same artifact skips what already landed instead of
# failing on it. A bare `npm publish` loop could not be retried: the
# registry answers a repeat of an existing version permanently.
run: node ./scripts/publish-release.mjs dist/npm
-101
View File
@@ -1,101 +0,0 @@
name: Release (SSH helper)
# Validation accepts any ref; publication requires the matching dsh-v<version> tag.
on:
workflow_dispatch:
inputs:
publish:
description: Publish verified archives to GitHub Release. Must run from the matching dsh-v<version> tag.
type: boolean
required: true
default: false
permissions:
contents: read
concurrency:
group: publish-ssh-helper-${{ github.ref }}
cancel-in-progress: false
jobs:
validate:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.source.outputs.version }}
commit: ${{ steps.source.outputs.commit }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Resolve source and validate publication tag
id: source
env:
PUBLISH: ${{ inputs.publish }}
run: |
node --input-type=module <<'JS'
import { readFileSync, appendFileSync } from 'node:fs';
import { execFileSync } from 'node:child_process';
const {version} = JSON.parse(readFileSync('package.json', 'utf8'));
if (process.env.PUBLISH === 'true' && (process.env.GITHUB_REF_TYPE !== 'tag' || process.env.GITHUB_REF_NAME !== `dsh-v${version}`)) throw new Error('Publication requires the matching dsh-v<version> tag');
const commit = execFileSync('git', ['rev-parse', 'HEAD'], {encoding:'utf8'}).trim();
appendFileSync(process.env.GITHUB_OUTPUT, `version=${version}\ncommit=${commit}\n`);
JS
build:
needs: validate
uses: ./.github/workflows/build-exe-for-ssh-helper.yml
with:
release: true
verify:
needs: [validate, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
with:
dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v6
with:
node-version: '^24.22.3'
cache: pnpm
- run: pnpm install --frozen-lockfile
- uses: actions/download-artifact@v8
with:
pattern: ssh-helper-node24-*
path: dist-exe/ssh-helper
merge-multiple: true
- name: Require complete evidence from the selected source commit
env:
RELEASE_VERSION: ${{ needs.validate.outputs.version }}
SOURCE_COMMIT: ${{ needs.validate.outputs.commit }}
run: pnpm exec tsx scripts/ssh-helper/release.ts --directory=dist-exe/ssh-helper --version="$RELEASE_VERSION" --commit="$SOURCE_COMMIT"
- name: Upload verified release checksums
uses: actions/upload-artifact@v7
with:
name: ssh-helper-release-checksums
path: dist-exe/ssh-helper/SHA256SUMS
if-no-files-found: error
publish:
if: inputs.publish
needs: [validate, verify]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v8
with:
pattern: ssh-helper-*
path: dist-exe/ssh-helper
merge-multiple: true
- name: Attach the verified archives to the GitHub release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
if ! gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
gh release create "$RELEASE_TAG" --verify-tag --draft --title "$RELEASE_TAG" --notes 'SSH helper executables for Linux and macOS.'
fi
gh release upload "$RELEASE_TAG" dist-exe/ssh-helper/*.tar.gz dist-exe/ssh-helper/SHA256SUMS
-248
View File
@@ -1,248 +0,0 @@
name: Release (Python)
# A manual run with publish=false builds and validates the complete release
# without registry credentials. Publication is accepted only from a manual run
# on the matching python-v* tag when the private publisher-repository identity
# and public-PyPI switch are configured.
on:
workflow_dispatch:
inputs:
publish:
description: Publish the validated wheels to public PyPI. Must run from a python-v* tag.
required: true
type: boolean
default: false
permissions:
contents: read
concurrency:
# Public runs stay globally serialized across tags. Dry runs remain isolated
# by ref so they do not block an intentional publication.
group: ${{ github.event_name == 'workflow_dispatch' && inputs.publish && 'python-publication' || format('{0}-{1}', github.workflow, github.ref) }}
cancel-in-progress: false
jobs:
build:
name: Build six wheels
uses: ./.github/workflows/build-exe-for-python-sdk.yml
with:
targets: node24-linux-x64,node24-linux-arm64,node24-macos-arm64,node24-macos-x64,node24-win-x64
release: true
python-compat:
name: Python ${{ matrix.python }} / installed SDK
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: ['3.10', '3.14']
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@v6.3.0
with:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@v8.0.1
with:
pattern: deepseek_harness_*
path: dist
merge-multiple: true
- name: Resolve installed wheel version
id: compatibility-version
run: |
python - <<'PY' >> "$GITHUB_OUTPUT"
import runpy
release = runpy.run_path("scripts/build-python-release.py")
repository_version = release["repository_version"]()
print(f"version={release['pep440_version'](repository_version)}")
PY
- name: Install local release wheels and run the public entry path
env:
VERSION: ${{ steps.compatibility-version.outputs.version }}
run: |
python -m pip install \
"dist/deepseek_harness_sdk-$VERSION-py3-none-any.whl" \
"dist/deepseek_harness_runtime_bin-$VERSION-py3-none-manylinux_2_28_x86_64.whl"
python scripts/smoke-python-runtime.py --scenario sdk-default
python scripts/smoke-python-runtime.py --scenario sdk-mcp
validate:
name: Validate release candidate
needs: [build, python-compat]
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@v6.3.0
with:
python-version: '3.10'
- name: Resolve release version
id: version
run: |
python3 - <<'PY' >> "$GITHUB_OUTPUT"
import runpy
release = runpy.run_path("scripts/build-python-release.py")
repository_version = release["repository_version"]()
wheel_version = release["pep440_version"](repository_version)
print(f"repository-version={repository_version}")
print(f"version={wheel_version}")
PY
- name: Authorize publication request
env:
PUBLISH: ${{ github.event_name == 'workflow_dispatch' && inputs.publish }}
PUBLIC_PYPI_RELEASE_ENABLED: ${{ vars.PUBLIC_PYPI_RELEASE_ENABLED }}
PYPI_PUBLISHER_REPOSITORY: ${{ vars.PYPI_PUBLISHER_REPOSITORY }}
REPOSITORY: ${{ github.repository }}
REF_NAME: ${{ github.ref_name }}
REF_TYPE: ${{ github.ref_type }}
REPOSITORY_VERSION: ${{ steps.version.outputs.repository-version }}
run: |
set -euo pipefail
if [ "$PUBLISH" = true ]; then
[ -n "$PYPI_PUBLISHER_REPOSITORY" ] || {
echo "::error::Set the repository variable PYPI_PUBLISHER_REPOSITORY before publication."
exit 1
}
[ "$REPOSITORY" = "$PYPI_PUBLISHER_REPOSITORY" ] || {
echo "::error::This repository is not the configured PyPI publisher repository."
exit 1
}
[ "$PUBLIC_PYPI_RELEASE_ENABLED" = true ] || {
echo "::error::Set PUBLIC_PYPI_RELEASE_ENABLED=true before public publication."
exit 1
}
[ "$REF_TYPE" = tag ] && [ "$REF_NAME" = "python-v$REPOSITORY_VERSION" ] || {
echo "::error::Publication must run from tag python-v$REPOSITORY_VERSION."
exit 1
}
fi
- uses: actions/download-artifact@v8.0.1
with:
pattern: deepseek_harness_*
path: dist
merge-multiple: true
- name: Check release contents
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
set -euo pipefail
expected="$(mktemp)"
actual="$(mktemp)"
printf '%s\n' \
"deepseek_harness_runtime_bin-$VERSION-py3-none-macosx_14_0_arm64.whl" \
"deepseek_harness_runtime_bin-$VERSION-py3-none-macosx_14_0_x86_64.whl" \
"deepseek_harness_runtime_bin-$VERSION-py3-none-manylinux_2_28_aarch64.whl" \
"deepseek_harness_runtime_bin-$VERSION-py3-none-manylinux_2_28_x86_64.whl" \
"deepseek_harness_runtime_bin-$VERSION-py3-none-win_amd64.whl" \
"deepseek_harness_sdk-$VERSION-py3-none-any.whl" > "$expected"
find dist -maxdepth 1 -type f -name '*.whl' -exec basename {} \; | sort > "$actual"
diff -u "$expected" "$actual"
while IFS= read -r wheel; do
size="$(stat -c '%s' "dist/$wheel")"
[ "$size" -lt 100000000 ] || {
echo "::error::$wheel is $size bytes; public PyPI accepts at most 100000000 bytes by default."
exit 1
}
done < "$actual"
- name: Validate package metadata
run: |
python -m pip install twine==6.2.0
python -m twine check dist/*.whl
- name: Record artifact hashes
run: |
cd dist
sha256sum *.whl | sort -k2 > SHA256SUMS
cat SHA256SUMS
- uses: actions/upload-artifact@v7.0.1
with:
name: python-release-${{ steps.version.outputs.version }}
path: dist/*
if-no-files-found: error
retention-days: 7
publish-runtime:
name: Publish runtime wheels to public PyPI
if: github.event_name == 'workflow_dispatch' && inputs.publish
needs: validate
runs-on: ubuntu-latest
timeout-minutes: 10
environment: pypi-runtime
permissions:
contents: read
id-token: write
steps:
- uses: actions/download-artifact@v8.0.1
with:
name: python-release-${{ needs.validate.outputs.version }}
path: dist
- name: Verify release artifact hashes
run: cd dist && sha256sum -c SHA256SUMS
- name: Select runtime wheels
run: |
mkdir -p dist/runtime
mv dist/deepseek_harness_runtime_bin-*.whl dist/runtime/
- name: Publish runtime wheels
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/runtime/
# Public attestations reveal the private publisher repository. OIDC
# authentication remains enabled without uploading that repository identity.
attestations: false
# Keep the SDK in a dependent job. If its upload fails after the immutable
# runtime files arrive, "re-run failed jobs" resumes here without attempting
# to overwrite the runtime release.
publish-sdk:
name: Publish SDK wheel to public PyPI
if: github.event_name == 'workflow_dispatch' && inputs.publish
needs: [validate, publish-runtime]
runs-on: ubuntu-latest
timeout-minutes: 10
environment: pypi
permissions:
contents: read
id-token: write
steps:
- uses: actions/download-artifact@v8.0.1
with:
name: python-release-${{ needs.validate.outputs.version }}
path: dist
- name: Verify release artifact hashes
run: cd dist && sha256sum -c SHA256SUMS
- name: Select SDK wheel
run: |
mkdir -p dist/sdk
mv dist/deepseek_harness_sdk-*.whl dist/sdk/
- name: Publish SDK wheel
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/sdk/
attestations: false
-182
View File
@@ -1,182 +0,0 @@
# Publish the dsh release sequence to npm. This workflow is manual-only
# (workflow_dispatch) and intentionally does not listen to pull_request or push:
# publication is an explicit, reviewed act; dsh-v* tag validation is enabled by
# default and may be skipped through the dispatch input. It never appears as a PR check. It repacks the current tree before publishing
# so the bytes uploaded are exactly what this dispatch produced.
name: Release publish (dsh)
on:
workflow_dispatch:
inputs:
cua_macos_run_id:
description: 'macOS CUA helper run ID,留空复用源码逐字节一致的产物,无匹配则构建'
type: string
required: false
default: ''
skip-tag-check:
description: Skip release tag validation for the selected ref; other publication checks still apply.
type: boolean
required: false
default: false
permissions:
contents: read
actions: read
env:
PRIMARY_NODE_VERSION: '^24.22.3'
DSH_TELEMETRY_DISABLED: '1'
jobs:
cua-helper-macos:
if: startsWith(github.ref, 'refs/tags/dsh-v') || inputs.skip-tag-check
uses: ./.github/workflows/cua-helper-package-macos.yml
with:
reuse: true
preset: production
cua_macos_run_id: ${{ inputs.cua_macos_run_id }}
pack:
name: Pack npm tarballs
needs: cua-helper-macos
runs-on: ubuntu-24.04
permissions:
contents: read
actions: read
steps:
# Complete history: the release scripts read tags.
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: pnpm/action-setup@v5.0.0
with:
dest: ${{ runner.temp }}/setup-pnpm
- uses: actions/setup-node@v7.0.0
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Configure pnpm store path
id: pnpm-store
run: |
store_root="$HOME/.local/share/pnpm/store"
echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
echo "path=$store_path" >> "$GITHUB_OUTPUT"
- uses: actions/cache/restore@v6.1.0
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
- name: Install (immutable)
run: pnpm install --frozen-lockfile
- name: Verify release version
env:
RELEASE_PUBLISH: 'true'
run: pnpm run release:verify --family dsh ${{ inputs.skip-tag-check && '--skip-tag-check' || '' }}
- name: Download selected macOS CUA helper
uses: actions/download-artifact@v8.0.1
with:
artifact-ids: ${{ needs.cua-helper-macos.outputs.artifact-id }}
run-id: ${{ needs.cua-helper-macos.outputs.run-id }}
github-token: ${{ github.token }}
path: dist/cua-helper
- name: Build
run: pnpm run build:official --serial
- name: Stage verified macOS helper applications
env:
CUA_EXPECTED_BUILD_KEY: ${{ needs.cua-helper-macos.outputs.build-key }}
run: |
mkdir dist/cua-helper/extracted
tar -xzf dist/cua-helper/cua-helper.tgz -C dist/cua-helper/extracted
pnpm exec tsx scripts/cua-helper/stage.ts --from dist/cua-helper/extracted
- name: Record macOS CUA source and publication retry instructions
env:
CUA_MACOS_RUN_ID: ${{ needs.cua-helper-macos.outputs.run-id }}
CUA_ARTIFACT_ID: ${{ needs.cua-helper-macos.outputs.artifact-id }}
run: |
{
printf '采用 macOS CUA helper 构建 run ID `%s`,artifact ID `%s`。\n\n' "$CUA_MACOS_RUN_ID" "$CUA_ARTIFACT_ID"
printf '%s\n\n' 'npm 部分发布失败时,只重跑 Publish to npm job,复用原 dsh-npm-tarballs;不要重跑全部 job。'
printf '需要重新打包时,可留空自动查找,或填写 `cua_macos_run_id=%s` 指定该 helper;源码和构建配置必须匹配。\n' "$CUA_MACOS_RUN_ID"
} >> "$GITHUB_STEP_SUMMARY"
- name: Pack release tarballs
run: pnpm run release:pack --family dsh --out dist/npm
# The harness packages declare the vendored framework as a peer, and this
# verification must not depend on the registry already carrying matching
# versions — one pull request may bump both families before either
# publishes — so it installs that family's pack output too. Only dist/npm
# is published.
- name: Pack the vendored framework for verification
run: pnpm run release:pack --family vendor --out dist/npm-vendor
# dsh-sandbox-local declares the Landlock entry as a runtime dependency, so
# the verification needs its tarball. Its platform packages stay out: they
# are optional, and building them needs a musl toolchain per architecture.
- name: Pack the Landlock entry for verification
run: |
pnpm --dir native/system run build:ts
pnpm --dir native/system/packages/entry pack --pack-destination "$PWD/dist/npm-landlock"
- name: Verify packed install
run: pnpm run release:verify-packed-install --family dsh --from dist/npm --from dist/npm-vendor --from dist/npm-landlock
- uses: actions/upload-artifact@v7.0.1
with:
name: dsh-npm-tarballs
path: dist/npm/*
if-no-files-found: error
retention-days: 7
publish:
name: Publish to npm
needs: pack
runs-on: ubuntu-24.04
# Required reviewers and the allowed tags live on the environment; this is
# the only job in the sequence that can write to the registry.
environment: npm-publish
concurrency:
group: Release-publish
cancel-in-progress: false
permissions:
contents: read
steps:
# Checkout and install carry the release scripts only. There is no build
# step: publication uploads the bytes the pack job produced.
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: pnpm/action-setup@v5.0.0
with:
dest: ${{ runner.temp }}/setup-pnpm
- uses: actions/setup-node@v7.0.0
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
registry-url: https://registry.npmjs.org
- name: Install (immutable, no package scripts)
run: pnpm install --frozen-lockfile --ignore-scripts
- uses: actions/download-artifact@v8.0.1
with:
name: dsh-npm-tarballs
path: dist/npm
- name: Publish tarballs
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm run release:publish --family dsh --from dist/npm
@@ -1,126 +0,0 @@
# Publish the vendored framework sequence to npm. This workflow is manual-only
# (workflow_dispatch) and intentionally does not listen to pull_request or push:
# publication must always be an explicit, reviewed act from a vendor-* tag, and
# it must never appear as a PR check. It repacks the current tree before
# publishing so the bytes uploaded are exactly what this dispatch produced.
name: Release publish (vendor)
on:
workflow_dispatch:
inputs:
dist-tag:
description: Optional unused npm channel. Leave empty for latest (stable) or next (prerelease).
required: false
type: string
default: ''
permissions:
contents: read
env:
PRIMARY_NODE_VERSION: '^24.22.3'
DSH_TELEMETRY_DISABLED: '1'
jobs:
pack:
name: Pack npm tarballs
runs-on: ubuntu-24.04
steps:
# Complete history: the release scripts read tags.
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: pnpm/action-setup@v5.0.0
with:
dest: ${{ runner.temp }}/setup-pnpm
- uses: actions/setup-node@v7.0.0
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Configure pnpm store path
id: pnpm-store
run: |
store_root="$HOME/.local/share/pnpm/store"
echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
echo "path=$store_path" >> "$GITHUB_OUTPUT"
- uses: actions/cache/restore@v6.1.0
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
- name: Install (immutable)
run: pnpm install --frozen-lockfile
- name: Verify release version
env:
RELEASE_PUBLISH: 'true'
run: pnpm run release:verify --family vendor
# The vendored packages publish their own sources and build outputs; the
# host build produces what their manifests select.
- name: Build
run: pnpm run build:lib:host
- name: Pack release tarballs
run: pnpm run release:pack --family vendor --out dist/npm-vendor
- name: Verify packed install
run: pnpm run release:verify-packed-install --family vendor --from dist/npm-vendor
- uses: actions/upload-artifact@v7.0.1
with:
name: vendor-npm-tarballs
path: dist/npm-vendor/*
if-no-files-found: error
retention-days: 7
publish:
name: Publish to npm
needs: pack
runs-on: ubuntu-24.04
environment: npm-publish
concurrency:
group: Release-publish
cancel-in-progress: false
permissions:
contents: read
steps:
# Checkout and install carry the release scripts only; no build step.
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: pnpm/action-setup@v5.0.0
with:
dest: ${{ runner.temp }}/setup-pnpm
- uses: actions/setup-node@v7.0.0
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
registry-url: https://registry.npmjs.org
- name: Install (immutable, no package scripts)
run: pnpm install --frozen-lockfile --ignore-scripts
- uses: actions/download-artifact@v8.0.1
with:
name: vendor-npm-tarballs
path: dist/npm-vendor
- name: Publish tarballs
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
RELEASE_DIST_TAG: ${{ inputs.dist-tag }}
run: |
args=()
if [[ -n "$RELEASE_DIST_TAG" ]]; then
args+=(--dist-tag "$RELEASE_DIST_TAG")
fi
pnpm run release:publish --family vendor --from dist/npm-vendor "${args[@]}"
-107
View File
@@ -1,107 +0,0 @@
# Pack the vendored framework sequence: the nine rescoped Cordis packages under
# vendor/, each on its own version line. This sequence releases independently of
# dsh and of the native packages.
#
# Pack runs without credentials on every pull request and master push.
# Publication is a manual workflow_dispatch of release-vendor-publish.yml from a
# vendor-* tag; a vendor release can carry several versions, so each package has
# its own tag.
name: Release (vendor)
on:
pull_request:
push:
branches: [master]
workflow_dispatch:
permissions:
contents: read
concurrency:
# Pack runs per ref so concurrent pull requests never displace each other.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PRIMARY_NODE_VERSION: '^24.22.3'
DSH_TELEMETRY_DISABLED: '1'
jobs:
pack:
name: Pack npm tarballs
# Persistent runners accept only trusted, credential-free rehearsals.
runs-on: >-
${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
&& github.repository == 'deepseek-harness/deepseek-harness'
&& github.actor != 'dependabot[bot]'
&& ((github.event_name == 'push' && github.ref == 'refs/heads/master')
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository
&& github.event.pull_request.head.repo.fork == false
&& github.event.pull_request.user.login != 'dependabot[bot]'))
&& fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
|| 'ubuntu-24.04' }}
steps:
# Complete history: the release scripts read tags.
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
persist-credentials: false
clean: true
- name: Configure runner-private caches
run: |
echo "NODE_COMPILE_CACHE=${{ runner.temp }}/node-compile-cache" >> "$GITHUB_ENV"
echo "npm_config_devdir=${{ runner.temp }}/node-gyp" >> "$GITHUB_ENV"
echo "TMPDIR=${{ runner.temp }}" >> "$GITHUB_ENV"
- uses: pnpm/action-setup@v5.0.0
with:
dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
- uses: actions/setup-node@v7.0.0
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
package-manager-cache: false
- name: Configure pnpm store path
id: pnpm-store
run: |
store_root="$HOME/.local/share/pnpm/store"
echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
echo "path=$store_path" >> "$GITHUB_OUTPUT"
- uses: actions/cache/restore@v6.1.0
if: runner.environment == 'github-hosted'
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
- name: Install (immutable)
run: pnpm install --frozen-lockfile
- name: Verify release version
run: pnpm run release:verify --family vendor
# The vendored packages publish their own sources and build outputs; the
# host build produces what their manifests select.
- name: Build
run: ${{ github.event_name == 'pull_request' && 'pnpm exec tsx scripts/compile-referenced-projects.ts host-libraries' || 'pnpm run build:lib:host' }}
# Concurrency here is rehearsal-only: the credentialed publish workflows
# invoke release:pack without the flag and keep the strictly serial path.
- name: Pack release tarballs
run: pnpm run release:pack --family vendor --out dist/npm-vendor --concurrency 8
- name: Verify packed install
run: pnpm run release:verify-packed-install --family vendor --from dist/npm-vendor
- uses: actions/upload-artifact@v7.0.1
with:
name: vendor-npm-tarballs
path: dist/npm-vendor/*
if-no-files-found: error
retention-days: 7
-190
View File
@@ -1,190 +0,0 @@
# Pack the dsh release sequence: every package under packages/ plus the apps/
# entries, all on one version. The vendored framework and the native packages are
# separate sequences with their own workflows and version lines.
#
# Pack and dependency-layout verification run without credentials on every pull
# request and master push. Publication is a manual workflow_dispatch of
# release-publish.yml from a dsh-v* tag.
name: Release (dsh)
on:
pull_request:
push:
branches: [master]
workflow_dispatch:
permissions:
contents: read
concurrency:
# Pack runs per ref so concurrent pull requests never displace each other.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PRIMARY_NODE_VERSION: '^24.22.3'
DSH_TELEMETRY_DISABLED: '1'
jobs:
dependencies:
name: Dependency layout
# Persistent runners accept only trusted, credential-free rehearsals.
runs-on: >-
${{ vars.DSH_CI_FAILOVER_LINUX == 'blacksmith' && 'blacksmith-4vcpu-ubuntu-2404'
|| vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
&& github.repository == 'deepseek-harness/deepseek-harness'
&& github.actor != 'dependabot[bot]'
&& ((github.event_name == 'push' && github.ref == 'refs/heads/master')
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository
&& github.event.pull_request.head.repo.fork == false
&& github.event.pull_request.user.login != 'dependabot[bot]'))
&& fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
|| 'ubuntu-24.04' }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
clean: true
- name: Configure runner-private caches
run: |
echo "NODE_COMPILE_CACHE=${{ runner.temp }}/node-compile-cache" >> "$GITHUB_ENV"
echo "npm_config_devdir=${{ runner.temp }}/node-gyp" >> "$GITHUB_ENV"
echo "TMPDIR=${{ runner.temp }}" >> "$GITHUB_ENV"
- uses: pnpm/action-setup@v5.0.0
with:
dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
- uses: actions/setup-node@v7.0.0
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
package-manager-cache: false
- name: Configure pnpm store path
id: pnpm-store
run: |
store_root="$HOME/.local/share/pnpm/store"
echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
echo "path=$store_path" >> "$GITHUB_OUTPUT"
- uses: actions/cache/restore@v6.1.0
if: runner.environment == 'github-hosted'
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
- name: Install (immutable)
run: pnpm install --frozen-lockfile
# The two verifications read different inputs (manifests versus an npm
# install in a scratch directory), so they run beside each other.
- name: Verify dependency policy and npm install layout
run: |
pnpm run verify-package-dependencies &
dependencies_pid=$!
pnpm run verify-npm-install-layout &
layout_pid=$!
dependencies_status=0
wait "$dependencies_pid" || dependencies_status=$?
layout_status=0
wait "$layout_pid" || layout_status=$?
if (( dependencies_status != 0 )); then exit "$dependencies_status"; fi
exit "$layout_status"
pack:
name: Pack npm tarballs
# Persistent runners accept only trusted, credential-free rehearsals.
runs-on: >-
${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
&& github.repository == 'deepseek-harness/deepseek-harness'
&& github.actor != 'dependabot[bot]'
&& ((github.event_name == 'push' && github.ref == 'refs/heads/master')
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository
&& github.event.pull_request.head.repo.fork == false
&& github.event.pull_request.user.login != 'dependabot[bot]'))
&& fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
|| 'ubuntu-24.04' }}
steps:
# Complete history: the release scripts read tags.
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
persist-credentials: false
clean: true
- name: Configure runner-private caches
run: |
echo "NODE_COMPILE_CACHE=${{ runner.temp }}/node-compile-cache" >> "$GITHUB_ENV"
echo "npm_config_devdir=${{ runner.temp }}/node-gyp" >> "$GITHUB_ENV"
echo "TMPDIR=${{ runner.temp }}" >> "$GITHUB_ENV"
- uses: pnpm/action-setup@v5.0.0
with:
dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
- uses: actions/setup-node@v7.0.0
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
package-manager-cache: false
- name: Configure pnpm store path
id: pnpm-store
run: |
store_root="$HOME/.local/share/pnpm/store"
echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
echo "path=$store_path" >> "$GITHUB_OUTPUT"
- uses: actions/cache/restore@v6.1.0
if: runner.environment == 'github-hosted'
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
- name: Install (immutable)
run: pnpm install --frozen-lockfile
- name: Verify release version
run: pnpm run release:verify --family dsh
- name: Build
run: ${{ github.event_name == 'pull_request' && 'pnpm run build:artifacts --profile official' || 'pnpm run build:official' }}
# Concurrency here is rehearsal-only: the credentialed publish workflows
# invoke release:pack without the flag and keep the strictly serial path.
- name: Pack release tarballs
run: pnpm run release:pack --family dsh --out dist/npm --concurrency 8
# The harness packages declare the vendored framework as a peer, and this
# verification must not depend on the registry already carrying matching
# versions — one pull request may bump both families before either
# publishes — so it installs that family's pack output too. Only dist/npm
# is published.
- name: Pack the vendored framework for verification
run: pnpm run release:pack --family vendor --out dist/npm-vendor --concurrency 8
# dsh-sandbox-local declares the Landlock entry as a runtime dependency, so
# the verification needs its tarball. Its platform packages stay out: they
# are optional, and building them needs a musl toolchain per architecture.
- name: Pack the Landlock entry for verification
run: |
pnpm --dir native/system run build:ts
pnpm --dir native/system/packages/entry pack --pack-destination "$PWD/dist/npm-landlock"
- name: Verify packed install
run: pnpm run release:verify-packed-install --family dsh --from dist/npm --from dist/npm-vendor --from dist/npm-landlock
- uses: actions/upload-artifact@v7.0.1
with:
name: dsh-npm-tarballs
path: dist/npm/*
if-no-files-found: error
retention-days: 7
-278
View File
@@ -1,278 +0,0 @@
name: Package Desktop · Windows · x64
on:
workflow_dispatch:
inputs:
source_ref:
description: '打包源码:test 支持仓库内分支或 dsh-v* tag;production 仅支持 master 或 dsh-v* tag;源码须包含 CI 适配脚本'
type: string
default: master
required: true
preset:
description: '打包环境:选择机器上的 test 或 production 配置;同时决定后续发布环境'
type: choice
options: [test, production]
default: test
required: true
update_channel:
description: '升级通道:人工选择 nightly 或 stable,与版本后缀无关;默认通道由此打包输入确定'
type: choice
options: [nightly, stable]
default: nightly
required: true
version_mode:
description: '版本模式:default 按环境自动选择(test 取 build-number,production 取 follow-dsh);follow-dsh 跟随 dsh 包版本号;build-number 自动追加构建编号;manual 手填'
type: choice
options: [default, follow-dsh, build-number, manual]
default: default
required: true
build_version:
description: '手动版本号:仅 manual 时填写完整版本;须为产品原版本或受支持的预发布后缀'
type: string
default: ''
required: false
test_release_id:
description: '测试 release ID:32 位小写十六进制随机前缀(非鉴权);留空使用机器默认值,连续升级测试须保持相同值'
type: string
default: ''
required: false
compression_level:
description: '安装器压缩等级:3 打包较快,7 压缩更强;覆盖本轮机器配置'
type: choice
options: ['3', '7']
default: '3'
required: true
signing:
description: '签名方式:unsigned 仅限内部调试,禁止发布到 test / production 或用于自动更新;需要发布请选择 signed(EV 硬件令牌)'
type: choice
options: [signed, unsigned]
default: signed
required: true
cache_namespace:
description: '缓存测量命名空间:留空使用共享缓存;新名称用于冷缓存,再次使用同名测热缓存,不清除现有缓存'
type: string
default: ''
required: false
permissions:
contents: read
concurrency:
group: windows-desktop-package
cancel-in-progress: false
jobs:
package:
outputs:
directory: ${{ steps.retained.outputs.directory }}
runner: ${{ steps.retained.outputs.runner }}
runner-name: ${{ steps.retained.outputs.runner-name }}
attempt: ${{ steps.retained.outputs.attempt }}
version: ${{ steps.settings.outputs.version }}
mode: ${{ steps.settings.outputs.mode }}
runs-on: dsh-win-package-trial
timeout-minutes: 120
defaults:
run:
shell: pwsh
env:
PACKAGE_SOURCE_REF: ${{ inputs.source_ref }}
# TODO: Remove this legacy source_ref mode mapping on 2027-01-04 with the parser aliases.
PACKAGE_VERSION_MODE: ${{ inputs.version_mode == 'follow-dsh' && 'product' || inputs.version_mode == 'build-number' && 'auto' || inputs.version_mode }}
DSH_DESKTOP_UPDATE_CHANNEL: ${{ inputs.update_channel }}
DSH_TELEMETRY_DISABLED: '1'
DSH_PACKAGING_PRESET: ${{ inputs.preset }}
PACKAGE_TEST_RELEASE_ID: ${{ inputs.test_release_id }}
PACKAGE_SIGNING: ${{ inputs.signing }}
PACKAGE_CACHE_NAMESPACE: ${{ inputs.cache_namespace }}
PACKAGE_WINDOWS_COMPRESSION_LEVEL: ${{ inputs.compression_level }}
steps:
- name: Reset packaging checkout
working-directory: ${{ runner.temp }}
run: |
$workspace = [IO.Path]::GetFullPath($env:GITHUB_WORKSPACE)
$parent = [IO.Path]::GetFullPath($env:RUNNER_WORKSPACE)
if ([IO.Path]::GetDirectoryName($workspace) -ne $parent) { throw 'Checkout must be a direct child of RUNNER_WORKSPACE' }
for ($item = [IO.DirectoryInfo]::new($workspace); $null -ne $item; $item = $item.Parent) {
if ($item.Exists -and ($item.Attributes -band [IO.FileAttributes]::ReparsePoint)) { throw 'Checkout ancestors cannot be links' }
}
node -e "const fs = require('node:fs'); fs.rmSync(process.argv[1], { recursive: true, force: true, maxRetries: 3 }); fs.mkdirSync(process.argv[1])" $workspace
if ($LASTEXITCODE -ne 0) { throw 'Checkout cleanup failed' }
- name: Checkout workflow helpers
uses: actions/checkout@v7.0.1
with:
persist-credentials: false
ref: ${{ github.workflow_sha }}
sparse-checkout: apps/desktop/scripts
- name: Stage workflow helpers
id: helpers
run: |
$helpers = Join-Path $env:RUNNER_TEMP "packaging-helpers-$env:GITHUB_RUN_ID-$env:GITHUB_RUN_ATTEMPT"
New-Item -ItemType Directory -Path $helpers -ErrorAction Stop | Out-Null
foreach ($name in @('windows-packaging-priority.ps1', 'windows-packaging-summary.mjs')) {
Copy-Item -LiteralPath (Join-Path 'apps/desktop/scripts' $name) -Destination $helpers -ErrorAction Stop
}
"PACKAGE_CI_HELPERS=$helpers" >> $env:GITHUB_ENV
- uses: actions/checkout@v7.0.1
id: checkout
with:
persist-credentials: false
clean: true
ref: ${{ inputs.source_ref }}
- name: Validate selected source and adapter support
run: >-
node -e "const fs=require('node:fs'); const ref=process.env.PACKAGE_SOURCE_REF;
const cp=require('node:child_process'); const preset=process.env.DSH_PACKAGING_PRESET;
if(!['test','production'].includes(preset)) throw Error('Unknown packaging preset');
const tag=/^dsh-v[0-9][0-9A-Za-z.-]*$/.test(ref);
if(preset==='production' && ref!=='master' && !tag) throw Error('Production source must be master or dsh-v*');
if(tag) {
const v=JSON.parse(fs.readFileSync('package.json','utf8')).version;
if(ref!=='dsh-v'+v) throw Error('Source tag must match product version');
const tagged=cp.execFileSync('git',['rev-parse','--verify','refs/tags/'+ref+'^{commit}'],{encoding:'utf8'}).trim();
const head=cp.execFileSync('git',['rev-parse','HEAD'],{encoding:'utf8'}).trim();
if(tagged!==head) throw Error('Checkout does not match source tag');
} else {
const branch=cp.execFileSync('git',['rev-parse','--abbrev-ref','HEAD'],{encoding:'utf8'}).trim();
if(branch==='HEAD' || branch!==ref || ref.startsWith('refs/')) throw Error('Select a branch in this repository, not a SHA or PR ref');
}
if(!fs.readFileSync('apps/desktop/scripts/retain-desktop-ci.ts','utf8').includes('--check-runner')) throw Error('Source lacks independent Desktop artifact archival support; select a newer source');
if(!fs.readFileSync('apps/desktop/scripts/desktop-ci-version.mjs','utf8').includes('PACKAGE_VERSION_MODE')) throw Error('Source lacks Desktop channel/version CI support; select a newer release');"
- uses: pnpm/action-setup@v5.0.0
with:
dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Configure persistent pnpm store
# PNPM_HOME belongs to this run; keep downloaded packages outside its temporary directory.
env:
DSH_DESKTOP_PACKAGE_CACHE_DIR: ${{ runner.tool_cache }}/dsh-desktop-package-cache
run: |
$storeRoot = Join-Path ([IO.Path]::GetPathRoot($env:GITHUB_WORKSPACE)) '.pnpm-store'
$namespace = $env:PACKAGE_CACHE_NAMESPACE
if ($namespace) {
if ($namespace -cnotmatch '^[a-z0-9][a-z0-9-]{0,63}\z') { throw 'Cache namespace must contain 1-64 lowercase letters, digits or hyphens' }
if ($namespace -match '^(con|prn|aux|nul|com[1-9]|lpt[1-9])$') { throw 'Cache namespace cannot be a Windows device name' }
$storeRoot = Join-Path $storeRoot $namespace
$env:DSH_DESKTOP_PACKAGE_CACHE_DIR = Join-Path $env:DSH_DESKTOP_PACKAGE_CACHE_DIR $namespace
}
"DSH_DESKTOP_PACKAGE_CACHE_DIR=$env:DSH_DESKTOP_PACKAGE_CACHE_DIR" >> $env:GITHUB_ENV
"PNPM_CONFIG_STORE_DIR=$storeRoot" >> $env:GITHUB_ENV
- name: Install locked dependencies
run: |
& "$env:PACKAGE_CI_HELPERS/windows-packaging-priority.ps1" -BestEffort
node -e "const os=require('node:os'); console.log(JSON.stringify({node:process.version,availableParallelism:os.availableParallelism(),logicalCpus:os.cpus().length,totalMemoryBytes:os.totalmem(),freeMemoryBytes:os.freemem()}))"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
pnpm store path
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
pnpm install --frozen-lockfile
exit $LASTEXITCODE
- name: Check original machine archival route
env:
DESKTOP_PUBLISH_RUNNERS: ${{ vars.DESKTOP_PUBLISH_RUNNERS }}
run: node --import tsx apps/desktop/scripts/retain-desktop-ci.ts --check-runner
- name: Validate preset and resolve build version
id: settings
env:
PACKAGE_BUILD_VERSION: ${{ inputs.build_version }}
run: node apps/desktop/scripts/prepare-windows-ci.mjs
- name: Summarize packaging parameters
if: always() && steps.helpers.outcome == 'success'
env:
PACKAGE_INPUT_VERSION_MODE: ${{ inputs.version_mode }}
PACKAGE_BUILD_VERSION: ${{ inputs.build_version }}
PACKAGE_SOURCE_SHA: ${{ steps.checkout.outputs.commit }}
PACKAGE_VERSION: ${{ steps.settings.outputs.version }}
run: node "$env:PACKAGE_CI_HELPERS/windows-packaging-summary.mjs"
- name: Check packaging configuration and toolchain
env:
PACKAGE_VERSION: ${{ steps.settings.outputs.version }}
run: |
$packageArgs = @('run', 'package:desktop:win:x64', '--check', '--build-version', $env:PACKAGE_VERSION)
if ($env:PACKAGE_SIGNING -eq 'unsigned') { $packageArgs += '--unsigned' }
pnpm @packageArgs
exit $LASTEXITCODE
- name: Build installer and verify packaged runtime
env:
PACKAGE_VERSION: ${{ steps.settings.outputs.version }}
run: |
& "$env:PACKAGE_CI_HELPERS/windows-packaging-priority.ps1" -BestEffort
$packageArgs = @('run', 'package:desktop:win:x64', '--build-version', $env:PACKAGE_VERSION)
if ($env:PACKAGE_SIGNING -eq 'unsigned') { $packageArgs += '--unsigned' }
pnpm @packageArgs
exit $LASTEXITCODE
- name: Retain complete package outside the checkout
id: retained
env:
DESKTOP_PUBLISH_RUNNERS: ${{ vars.DESKTOP_PUBLISH_RUNNERS }}
PACKAGE_SOURCE_SHA: ${{ steps.checkout.outputs.commit }}
PACKAGE_VERSION: ${{ steps.settings.outputs.version }}
run: node --import tsx apps/desktop/scripts/retain-desktop-ci.ts
- name: Retain packaging diagnostics
continue-on-error: true
if: always() && steps.checkout.outcome == 'success'
uses: actions/upload-artifact@v7.0.1
with:
name: windows-package-logs-${{ github.run_id }}-${{ github.run_attempt }}
include-hidden-files: true
path: ${{ github.workspace }}/apps/desktop/.desktop-build/packaging-runs/
if-no-files-found: warn
retention-days: 14
upload-artifact:
defaults:
run:
shell: pwsh
needs: package
runs-on: [self-hosted, '${{ needs.package.outputs.runner }}']
timeout-minutes: 30
env:
PACKAGE_CACHE_NAMESPACE: ${{ inputs.cache_namespace }}
DESKTOP_RETAINED_DIRECTORY: ${{ needs.package.outputs.directory }}
DESKTOP_ARCHIVE_NAME: windows-x64-${{ inputs.signing }}-${{ needs.package.outputs.version }}-${{ github.run_id }}-${{ needs.package.outputs.attempt }}.zip
DESKTOP_PACKAGE_ATTEMPT: ${{ needs.package.outputs.attempt }}
DESKTOP_PACKAGE_RUNNER: ${{ needs.package.outputs.runner-name }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
path: artifact-archiver
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: artifact-archiver/package.json
dest: ${{ runner.temp }}/archive-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v7.0.0
with:
node-version: '^24.22.3'
- name: Configure persistent pnpm store
# PNPM_HOME belongs to this run; keep downloaded packages outside its temporary directory.
env:
DSH_DESKTOP_PACKAGE_CACHE_DIR: ${{ runner.tool_cache }}/dsh-desktop-package-cache
run: |
$storeRoot = Join-Path ([IO.Path]::GetPathRoot($env:GITHUB_WORKSPACE)) '.pnpm-store'
$namespace = $env:PACKAGE_CACHE_NAMESPACE
if ($namespace) {
if ($namespace -cnotmatch '^[a-z0-9][a-z0-9-]{0,63}\z') { throw 'Cache namespace must contain 1-64 lowercase letters, digits or hyphens' }
if ($namespace -match '^(con|prn|aux|nul|com[1-9]|lpt[1-9])$') { throw 'Cache namespace cannot be a Windows device name' }
$storeRoot = Join-Path $storeRoot $namespace
$env:DSH_DESKTOP_PACKAGE_CACHE_DIR = Join-Path $env:DSH_DESKTOP_PACKAGE_CACHE_DIR $namespace
}
"DSH_DESKTOP_PACKAGE_CACHE_DIR=$env:DSH_DESKTOP_PACKAGE_CACHE_DIR" >> $env:GITHUB_ENV
"PNPM_CONFIG_STORE_DIR=$storeRoot" >> $env:GITHUB_ENV
- run: pnpm install --frozen-lockfile
working-directory: artifact-archiver
- name: Archive verified retained build
id: archive
working-directory: artifact-archiver
run: node --import tsx apps/desktop/scripts/archive-desktop-ci.ts
- name: Retain installers for the selected mode
if: success()
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ env.DESKTOP_ARCHIVE_NAME }}
path: ${{ steps.archive.outputs.path }}
archive: false
if-no-files-found: error
retention-days: 14
overwrite: true