release.yml 4.9 KB

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