release.yml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. - name: Pack release tarballs
  59. run: pnpm run release:pack --family dsh --out dist/npm
  60. # The harness packages declare the vendored framework as a peer, and this
  61. # verification must not depend on the registry already carrying matching
  62. # versions — one pull request may bump both families before either
  63. # publishes — so it installs that family's pack output too. Only dist/npm
  64. # is published.
  65. - name: Pack the vendored framework for verification
  66. run: pnpm run release:pack --family vendor --out dist/npm-vendor
  67. # dsh-sandbox-local declares the Landlock entry as a runtime dependency, so
  68. # the verification needs its tarball. Its platform packages stay out: they
  69. # are optional, and building them needs a musl toolchain per architecture.
  70. - name: Pack the Landlock entry for verification
  71. run: |
  72. pnpm --dir native/landlock-run run build:ts
  73. pnpm --dir native/landlock-run/packages/entry pack --pack-destination "$PWD/dist/npm-landlock"
  74. - name: Verify packed install
  75. run: pnpm run release:verify-packed-install --family dsh --from dist/npm --from dist/npm-vendor --from dist/npm-landlock
  76. - uses: actions/upload-artifact@v4
  77. with:
  78. name: dsh-npm-tarballs
  79. path: dist/npm/*
  80. if-no-files-found: error
  81. retention-days: 7