release.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 runs without credentials on every pull request and master push, so a
  6. # pull request proves the whole publish set still packs. Publication is a manual
  7. # workflow_dispatch of 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. pack:
  25. name: Pack npm tarballs
  26. runs-on: ubuntu-24.04
  27. steps:
  28. # Complete history: the release scripts read tags.
  29. - uses: actions/checkout@v6
  30. with:
  31. fetch-depth: 0
  32. persist-credentials: false
  33. - uses: pnpm/action-setup@v4
  34. with:
  35. dest: ${{ runner.temp }}/setup-pnpm
  36. - uses: actions/setup-node@v6
  37. with:
  38. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  39. - name: Configure pnpm store path
  40. id: pnpm-store
  41. run: |
  42. store_root="$HOME/.local/share/pnpm/store"
  43. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  44. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  45. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  46. - uses: actions/cache/restore@v4
  47. with:
  48. path: ${{ steps.pnpm-store.outputs.path }}
  49. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  50. restore-keys: |
  51. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  52. - name: Install (immutable)
  53. run: pnpm install --frozen-lockfile
  54. - name: Verify release version
  55. run: pnpm run release:verify --family dsh
  56. - name: Build
  57. run: pnpm run build:official
  58. # Concurrency here is rehearsal-only: the credentialed publish workflows
  59. # invoke release:pack without the flag and keep the strictly serial path.
  60. - name: Pack release tarballs
  61. run: pnpm run release:pack --family dsh --out dist/npm --concurrency 8
  62. # The harness packages declare the vendored framework as a peer, and this
  63. # verification must not depend on the registry already carrying matching
  64. # versions — one pull request may bump both families before either
  65. # publishes — so it installs that family's pack output too. Only dist/npm
  66. # is published.
  67. - name: Pack the vendored framework for verification
  68. run: pnpm run release:pack --family vendor --out dist/npm-vendor --concurrency 8
  69. # dsh-sandbox-local declares the Landlock entry as a runtime dependency, so
  70. # the verification needs its tarball. Its platform packages stay out: they
  71. # are optional, and building them needs a musl toolchain per architecture.
  72. - name: Pack the Landlock entry for verification
  73. run: |
  74. pnpm --dir native/landlock-run run build:ts
  75. pnpm --dir native/landlock-run/packages/entry pack --pack-destination "$PWD/dist/npm-landlock"
  76. - name: Verify packed install
  77. run: pnpm run release:verify-packed-install --family dsh --from dist/npm --from dist/npm-vendor --from dist/npm-landlock
  78. - uses: actions/upload-artifact@v4
  79. with:
  80. name: dsh-npm-tarballs
  81. path: dist/npm/*
  82. if-no-files-found: error
  83. retention-days: 7