release-vendor.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. # Pack and publish the vendored framework sequence: the nine rescoped Cordis
  2. # packages under vendor/, each on its own version line. This sequence releases
  3. # independently of dsh and of the native packages.
  4. #
  5. # Pack runs without credentials on every pull request and master push.
  6. # Publication is a manual dispatch from a vendor-* tag; a vendor release can
  7. # carry several versions, so each package has its own tag.
  8. name: Release (vendor)
  9. on:
  10. pull_request:
  11. push:
  12. branches: [master]
  13. workflow_dispatch:
  14. inputs:
  15. publish:
  16. description: Publish the packed tarballs to npm. Must run from a vendor-* tag.
  17. required: true
  18. type: boolean
  19. default: false
  20. permissions:
  21. contents: read
  22. concurrency:
  23. group: ${{ github.workflow }}
  24. cancel-in-progress: false
  25. env:
  26. PRIMARY_NODE_VERSION: '24'
  27. DSH_TELEMETRY_DISABLED: '1'
  28. jobs:
  29. pack:
  30. name: Pack npm tarballs
  31. runs-on: ubuntu-24.04
  32. steps:
  33. # Complete history: the release scripts read tags.
  34. - uses: actions/checkout@v6
  35. with:
  36. fetch-depth: 0
  37. persist-credentials: false
  38. - uses: pnpm/action-setup@v4
  39. with:
  40. dest: ${{ runner.temp }}/setup-pnpm
  41. - uses: actions/setup-node@v6
  42. with:
  43. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  44. - name: Configure pnpm store path
  45. id: pnpm-store
  46. run: |
  47. store_root="$HOME/.local/share/pnpm/store"
  48. echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
  49. store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
  50. echo "path=$store_path" >> "$GITHUB_OUTPUT"
  51. - uses: actions/cache/restore@v4
  52. with:
  53. path: ${{ steps.pnpm-store.outputs.path }}
  54. key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
  55. restore-keys: |
  56. ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
  57. - name: Install (immutable)
  58. run: pnpm install --frozen-lockfile
  59. - name: Verify release version
  60. env:
  61. RELEASE_PUBLISH: ${{ inputs.publish }}
  62. run: pnpm run release:verify --family vendor
  63. # The vendored packages publish their own sources and build outputs; the
  64. # host build produces what their manifests select.
  65. - name: Build
  66. run: pnpm run build:lib:host
  67. - name: Pack release tarballs
  68. run: pnpm run release:pack --family vendor --out dist/npm-vendor
  69. - name: Verify packed install
  70. run: pnpm run release:verify-packed-install --family vendor --from dist/npm-vendor
  71. - uses: actions/upload-artifact@v4
  72. with:
  73. name: vendor-npm-tarballs
  74. path: dist/npm-vendor/*
  75. if-no-files-found: error
  76. retention-days: 7
  77. publish:
  78. name: Publish to npm
  79. if: inputs.publish
  80. needs: pack
  81. runs-on: ubuntu-24.04
  82. environment: npm-publish
  83. permissions:
  84. contents: read
  85. id-token: write
  86. steps:
  87. # Checkout and install carry the release scripts only; no build step.
  88. - uses: actions/checkout@v6
  89. with:
  90. persist-credentials: false
  91. - uses: pnpm/action-setup@v4
  92. with:
  93. dest: ${{ runner.temp }}/setup-pnpm
  94. - uses: actions/setup-node@v6
  95. with:
  96. node-version: ${{ env.PRIMARY_NODE_VERSION }}
  97. registry-url: https://registry.npmjs.org
  98. - name: Install (immutable, no package scripts)
  99. run: pnpm install --frozen-lockfile --ignore-scripts
  100. - uses: actions/download-artifact@v4
  101. with:
  102. name: vendor-npm-tarballs
  103. path: dist/npm-vendor
  104. - name: Publish tarballs
  105. env:
  106. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  107. run: pnpm run release:publish --family vendor --from dist/npm-vendor