release.yml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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 "TMPDIR=${{ runner.temp }}" >> "$GITHUB_ENV"
  48. - uses: pnpm/action-setup@v4
  49. with:
  50. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  51. - uses: actions/setup-node@v6
  52. with:
  53. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  54. package-manager-cache: false
  55. - name: Configure pnpm store path
  56. id: pnpm-store
  57. run: |
  58. store_root="$HOME/.local/share/pnpm/store"
  59. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  60. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  61. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  62. - uses: actions/cache/restore@v4
  63. if: runner.environment == 'github-hosted'
  64. with:
  65. path: ${{ steps.pnpm-store.outputs.path }}
  66. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  67. restore-keys: |
  68. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  69. - name: Install (immutable)
  70. run: pnpm install --frozen-lockfile
  71. - name: Verify dependency policy
  72. run: pnpm run verify-package-dependencies
  73. - name: Verify npm install layout
  74. run: pnpm run verify-npm-install-layout
  75. pack:
  76. name: Pack npm tarballs
  77. # Persistent runners accept only trusted, credential-free rehearsals.
  78. runs-on: >-
  79. ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
  80. && github.repository == 'deepseek-harness/deepseek-harness'
  81. && github.actor != 'dependabot[bot]'
  82. && ((github.event_name == 'push' && github.ref == 'refs/heads/master')
  83. || (github.event_name == 'pull_request'
  84. && github.event.pull_request.head.repo.full_name == github.repository
  85. && github.event.pull_request.head.repo.fork == false
  86. && github.event.pull_request.user.login != 'dependabot[bot]'))
  87. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  88. || 'ubuntu-24.04' }}
  89. steps:
  90. # Complete history: the release scripts read tags.
  91. - uses: actions/checkout@v6
  92. with:
  93. fetch-depth: 0
  94. persist-credentials: false
  95. clean: true
  96. - name: Configure runner-private caches
  97. run: |
  98. echo "NODE_COMPILE_CACHE=${{ runner.temp }}/node-compile-cache" >> "$GITHUB_ENV"
  99. echo "npm_config_devdir=${{ runner.temp }}/node-gyp" >> "$GITHUB_ENV"
  100. echo "TMPDIR=${{ runner.temp }}" >> "$GITHUB_ENV"
  101. - uses: pnpm/action-setup@v4
  102. with:
  103. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  104. - uses: actions/setup-node@v6
  105. with:
  106. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  107. package-manager-cache: false
  108. - name: Configure pnpm store path
  109. id: pnpm-store
  110. run: |
  111. store_root="$HOME/.local/share/pnpm/store"
  112. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  113. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  114. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  115. - uses: actions/cache/restore@v4
  116. if: runner.environment == 'github-hosted'
  117. with:
  118. path: ${{ steps.pnpm-store.outputs.path }}
  119. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  120. restore-keys: |
  121. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  122. - name: Install (immutable)
  123. run: pnpm install --frozen-lockfile
  124. - name: Verify release version
  125. run: pnpm run release:verify --family dsh
  126. - name: Build
  127. run: pnpm run build:official
  128. # Concurrency here is rehearsal-only: the credentialed publish workflows
  129. # invoke release:pack without the flag and keep the strictly serial path.
  130. - name: Pack release tarballs
  131. run: pnpm run release:pack --family dsh --out dist/npm --concurrency 8
  132. # The harness packages declare the vendored framework as a peer, and this
  133. # verification must not depend on the registry already carrying matching
  134. # versions — one pull request may bump both families before either
  135. # publishes — so it installs that family's pack output too. Only dist/npm
  136. # is published.
  137. - name: Pack the vendored framework for verification
  138. run: pnpm run release:pack --family vendor --out dist/npm-vendor --concurrency 8
  139. # dsh-sandbox-local declares the Landlock entry as a runtime dependency, so
  140. # the verification needs its tarball. Its platform packages stay out: they
  141. # are optional, and building them needs a musl toolchain per architecture.
  142. - name: Pack the Landlock entry for verification
  143. run: |
  144. pnpm --dir native/system run build:ts
  145. pnpm --dir native/system/packages/entry pack --pack-destination "$PWD/dist/npm-landlock"
  146. - name: Verify packed install
  147. run: pnpm run release:verify-packed-install --family dsh --from dist/npm --from dist/npm-vendor --from dist/npm-landlock
  148. - uses: actions/upload-artifact@v4
  149. with:
  150. name: dsh-npm-tarballs
  151. path: dist/npm/*
  152. if-no-files-found: error
  153. retention-days: 7