Files
deepseek-harness/.github/workflows/release.yml
T
imccyu 129c915498 build: split build:src and build:test, and schedule build in parallel
pnpm run build ran every step in one serial chain, including the two
noEmit aggregate programs (tests, scripts, benchmarks, website) that no
artifact step consumes, so the Host aggregate check alone delayed tsdown by
about 66 s.

- build:src (scripts/build.ts --scope src) builds every artifact in the
  existing order and writes the client build record; it replaces the
  removed --artifacts-only flag and the libraries CLI mode.
- build:test (--scope test) type-checks only the Host and Client aggregate
  programs with tsc -p, concurrently, without compiling references or
  checking prerequisites.
- build runs both as one dependency graph through run-gates' new
  runAggregate: each aggregate check starts once its face's packages are
  compiled, and Client compilation stays after the Host bundle that writes
  the Typert /remote declarations. DSH_GATE_CONCURRENCY=1 serializes it;
  DSH_GATE_FAIL_FAST=1 stops the remaining steps at the first failure.
  Passing steps print one PASS line (DSH_GATE_VERBOSE=1 shows their output).
- PR artifact builds (e2e, release, preview, Node 22 compatibility) and the
  Python builder (--build-src) use build:src; dev:web and dev:desktop use
  build:src. test:*, bench, typecheck and the required consumer/Windows
  lanes keep the complete build.
- lint, lint:fix, doc-typecheck and the Typert contracts gate prepare with
  host-libraries (Host package compilation + Host bundle) instead of
  build:lib:host; their own checks never read the aggregate root or the
  Desktop bundle.

Parallel and serial build produce byte-identical lib/, Web dist and client
build record; a test-only type error fails build and build:test while
build:src passes.

Refs #5852
2026-10-11 18:19:23 +08:00

181 lines
7.2 KiB
YAML

# 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'
DSH_TELEMETRY_DISABLED: '1'
jobs:
dependencies:
name: Dependency layout
# 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:
- uses: actions/[email protected]
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/[email protected]
with:
dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
- uses: actions/[email protected]
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/[email protected]
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 dependency policy
run: pnpm run verify-package-dependencies
- name: Verify npm install layout
run: pnpm run verify-npm-install-layout
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/[email protected]
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/[email protected]
with:
dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
- uses: actions/[email protected]
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/[email protected]
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:src --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/[email protected]
with:
name: dsh-npm-tarballs
path: dist/npm/*
if-no-files-found: error
retention-days: 7