release.yml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. # Pack the dsh release sequence: every package under packages/ plus the apps/
  2. # entries, all on one version. The vendored framework and the native packages are
  3. # separate sequences with their own workflows and version lines.
  4. #
  5. # Pack and dependency-layout verification run without credentials on every pull
  6. # request and master push. Publication is a manual workflow_dispatch of
  7. # release-publish.yml from a dsh-v* tag.
  8. name: Release (dsh)
  9. on:
  10. pull_request:
  11. push:
  12. branches: [master]
  13. workflow_dispatch:
  14. permissions:
  15. contents: read
  16. concurrency:
  17. # Pack runs per ref so concurrent pull requests never displace each other.
  18. group: ${{ github.workflow }}-${{ github.ref }}
  19. cancel-in-progress: false
  20. env:
  21. PRIMARY_NODE_VERSION: '24'
  22. DSH_TELEMETRY_DISABLED: '1'
  23. jobs:
  24. dependencies:
  25. name: Dependency layout
  26. # Persistent runners accept only trusted, credential-free rehearsals.
  27. runs-on: >-
  28. ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
  29. && github.repository == 'deepseek-harness/deepseek-harness'
  30. && github.actor != 'dependabot[bot]'
  31. && ((github.event_name == 'push' && github.ref == 'refs/heads/master')
  32. || (github.event_name == 'pull_request'
  33. && github.event.pull_request.head.repo.full_name == github.repository
  34. && github.event.pull_request.head.repo.fork == false
  35. && github.event.pull_request.user.login != 'dependabot[bot]'))
  36. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  37. || 'ubuntu-24.04' }}
  38. steps:
  39. - uses: actions/checkout@v6
  40. with:
  41. persist-credentials: false
  42. clean: true
  43. - name: Configure runner-private caches
  44. run: |
  45. echo "NODE_COMPILE_CACHE=${{ runner.temp }}/node-compile-cache" >> "$GITHUB_ENV"
  46. echo "npm_config_devdir=${{ runner.temp }}/node-gyp" >> "$GITHUB_ENV"
  47. echo "npm_config_cache=${{ runner.temp }}/npm-cache" >> "$GITHUB_ENV"
  48. echo "TMPDIR=${{ runner.temp }}" >> "$GITHUB_ENV"
  49. - uses: pnpm/action-setup@v4
  50. with:
  51. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  52. - uses: actions/setup-node@v6
  53. with:
  54. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  55. package-manager-cache: false
  56. - name: Configure pnpm store path
  57. id: pnpm-store
  58. run: |
  59. store_root="${RUNNER_TEMP%/*}/pnpm-store"
  60. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  61. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  62. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  63. - uses: actions/cache/restore@v4
  64. if: runner.environment == 'github-hosted'
  65. with:
  66. path: ${{ steps.pnpm-store.outputs.path }}
  67. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  68. restore-keys: |
  69. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  70. - name: Install (immutable)
  71. run: pnpm install --frozen-lockfile
  72. - name: Verify dependency policy
  73. run: pnpm run verify-package-dependencies
  74. - name: Verify npm install layout
  75. run: pnpm run verify-npm-install-layout
  76. pack:
  77. name: Pack npm tarballs
  78. # Persistent runners accept only trusted, credential-free rehearsals.
  79. runs-on: >-
  80. ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
  81. && github.repository == 'deepseek-harness/deepseek-harness'
  82. && github.actor != 'dependabot[bot]'
  83. && ((github.event_name == 'push' && github.ref == 'refs/heads/master')
  84. || (github.event_name == 'pull_request'
  85. && github.event.pull_request.head.repo.full_name == github.repository
  86. && github.event.pull_request.head.repo.fork == false
  87. && github.event.pull_request.user.login != 'dependabot[bot]'))
  88. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  89. || 'ubuntu-24.04' }}
  90. steps:
  91. # Complete history: the release scripts read tags.
  92. - uses: actions/checkout@v6
  93. with:
  94. fetch-depth: 0
  95. persist-credentials: false
  96. clean: true
  97. - name: Configure runner-private caches
  98. run: |
  99. echo "NODE_COMPILE_CACHE=${{ runner.temp }}/node-compile-cache" >> "$GITHUB_ENV"
  100. echo "npm_config_devdir=${{ runner.temp }}/node-gyp" >> "$GITHUB_ENV"
  101. echo "npm_config_cache=${{ runner.temp }}/npm-cache" >> "$GITHUB_ENV"
  102. echo "TMPDIR=${{ runner.temp }}" >> "$GITHUB_ENV"
  103. - uses: pnpm/action-setup@v4
  104. with:
  105. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  106. - uses: actions/setup-node@v6
  107. with:
  108. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  109. package-manager-cache: false
  110. - name: Configure pnpm store path
  111. id: pnpm-store
  112. run: |
  113. store_root="${RUNNER_TEMP%/*}/pnpm-store"
  114. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  115. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  116. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  117. - uses: actions/cache/restore@v4
  118. if: runner.environment == 'github-hosted'
  119. with:
  120. path: ${{ steps.pnpm-store.outputs.path }}
  121. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  122. restore-keys: |
  123. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  124. - name: Install (immutable)
  125. run: pnpm install --frozen-lockfile
  126. - name: Verify release version
  127. run: pnpm run release:verify --family dsh
  128. - name: Build
  129. run: pnpm run build:official
  130. # Concurrency here is rehearsal-only: the credentialed publish workflows
  131. # invoke release:pack without the flag and keep the strictly serial path.
  132. - name: Pack release tarballs
  133. run: pnpm run release:pack --family dsh --out dist/npm --concurrency 8
  134. # The harness packages declare the vendored framework as a peer, and this
  135. # verification must not depend on the registry already carrying matching
  136. # versions — one pull request may bump both families before either
  137. # publishes — so it installs that family's pack output too. Only dist/npm
  138. # is published.
  139. - name: Pack the vendored framework for verification
  140. run: pnpm run release:pack --family vendor --out dist/npm-vendor --concurrency 8
  141. # dsh-sandbox-local declares the Landlock entry as a runtime dependency, so
  142. # the verification needs its tarball. Its platform packages stay out: they
  143. # are optional, and building them needs a musl toolchain per architecture.
  144. - name: Pack the Landlock entry for verification
  145. run: |
  146. pnpm --dir native/landlock-run run build:ts
  147. pnpm --dir native/landlock-run/packages/entry pack --pack-destination "$PWD/dist/npm-landlock"
  148. - name: Verify packed install
  149. run: pnpm run release:verify-packed-install --family dsh --from dist/npm --from dist/npm-vendor --from dist/npm-landlock
  150. - uses: actions/upload-artifact@v4
  151. with:
  152. name: dsh-npm-tarballs
  153. path: dist/npm/*
  154. if-no-files-found: error
  155. retention-days: 7