release-vendor.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # Pack the vendored framework sequence: the nine rescoped Cordis packages under
  2. # vendor/, each on its own version line. This sequence releases independently of
  3. # dsh and of the native packages.
  4. #
  5. # Pack runs without credentials on every pull request and master push.
  6. # Publication is a manual workflow_dispatch of release-vendor-publish.yml from a
  7. # vendor-* tag; a vendor release can carry several versions, so each package has
  8. # its own tag.
  9. name: Release (vendor)
  10. on:
  11. pull_request:
  12. push:
  13. branches: [master]
  14. workflow_dispatch:
  15. permissions:
  16. contents: read
  17. concurrency:
  18. # Pack runs per ref so concurrent pull requests never displace each other.
  19. group: ${{ github.workflow }}-${{ github.ref }}
  20. cancel-in-progress: true
  21. env:
  22. PRIMARY_NODE_VERSION: '24'
  23. DSH_TELEMETRY_DISABLED: '1'
  24. jobs:
  25. pack:
  26. name: Pack npm tarballs
  27. # Persistent runners accept only trusted, credential-free rehearsals.
  28. runs-on: >-
  29. ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
  30. && github.repository == 'deepseek-harness/deepseek-harness'
  31. && github.actor != 'dependabot[bot]'
  32. && ((github.event_name == 'push' && github.ref == 'refs/heads/master')
  33. || (github.event_name == 'pull_request'
  34. && github.event.pull_request.head.repo.full_name == github.repository
  35. && github.event.pull_request.head.repo.fork == false
  36. && github.event.pull_request.user.login != 'dependabot[bot]'))
  37. && fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
  38. || 'ubuntu-24.04' }}
  39. steps:
  40. # Complete history: the release scripts read tags.
  41. - uses: actions/checkout@v6
  42. with:
  43. fetch-depth: 0
  44. persist-credentials: false
  45. clean: true
  46. - name: Configure runner-private caches
  47. run: |
  48. echo "NODE_COMPILE_CACHE=${{ runner.temp }}/node-compile-cache" >> "$GITHUB_ENV"
  49. echo "npm_config_devdir=${{ runner.temp }}/node-gyp" >> "$GITHUB_ENV"
  50. echo "TMPDIR=${{ runner.temp }}" >> "$GITHUB_ENV"
  51. - uses: pnpm/action-setup@v4
  52. with:
  53. dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
  54. - uses: actions/setup-node@v6
  55. with:
  56. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  57. package-manager-cache: false
  58. - name: Configure pnpm store path
  59. id: pnpm-store
  60. run: |
  61. store_root="$HOME/.local/share/pnpm/store"
  62. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  63. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  64. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  65. - uses: actions/cache/restore@v4
  66. if: runner.environment == 'github-hosted'
  67. with:
  68. path: ${{ steps.pnpm-store.outputs.path }}
  69. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  70. restore-keys: |
  71. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  72. - name: Install (immutable)
  73. run: pnpm install --frozen-lockfile
  74. - name: Verify release version
  75. run: pnpm run release:verify --family vendor
  76. # The vendored packages publish their own sources and build outputs; the
  77. # host build produces what their manifests select.
  78. - name: Build
  79. run: pnpm run build:lib:host
  80. # Concurrency here is rehearsal-only: the credentialed publish workflows
  81. # invoke release:pack without the flag and keep the strictly serial path.
  82. - name: Pack release tarballs
  83. run: pnpm run release:pack --family vendor --out dist/npm-vendor --concurrency 8
  84. - name: Verify packed install
  85. run: pnpm run release:verify-packed-install --family vendor --from dist/npm-vendor
  86. - uses: actions/upload-artifact@v4
  87. with:
  88. name: vendor-npm-tarballs
  89. path: dist/npm-vendor/*
  90. if-no-files-found: error
  91. retention-days: 7