name: Modern.js Release Build # The build half of a release. It runs on the staging branch, which is where # preparation lands and which publishes nothing: the packed tarballs are kept # as a run artifact so that the rest of the release - in particular EdenX, in # another repository - can be built and tested against the exact bytes that # will later be published. release.yml then publishes those same artifacts. # # Splitting the two halves is what lets the human checkpoint sit after the # cross-repository test instead of before it. Nothing here needs an npm # identity, so this file is deliberately not the one npm trusts to publish. on: push: branches: ['canary-staging/**'] paths: ['.release/canary-plan.json'] permissions: contents: read concurrency: group: modern-release-build-${{ github.ref }} cancel-in-progress: false jobs: build: if: startsWith(github.ref, 'refs/heads/canary-staging/') runs-on: ubuntu-24.04 timeout-minutes: 90 permissions: contents: read outputs: plan_hash: ${{ steps.plan.outputs.plan_hash }} release_id: ${{ steps.plan.outputs.release_id }} steps: - name: Checkout exact source uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: ref: ${{ github.sha }} fetch-depth: 0 persist-credentials: false - name: Set up Node uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 with: node-version: '24.21.0' - name: Install pinned pnpm run: npm install --global pnpm@10.13.1 --ignore-scripts - name: Verify prepared source and plan id: plan run: node scripts/canary-release/release.mjs verify --staging - name: Install dependencies with native scripts run: node scripts/canary-release/release.mjs install - name: Test canary contracts, with the real Changesets and pnpm packing env: CANARY_TEST_TOOLCHAIN: . run: pnpm exec rstest run --config scripts/canary-release/rstest.config.mts - name: Build packages run: pnpm run prepare-build # A snapshot - a branch canary - skips these, as the canary pipeline # it replaces did: the branch's own CI runs the unit tests, and nobody # installs a canary for its documentation. Together they were 81 of the # build's 233 seconds on 2026-11-24. - name: Unit tests if: steps.plan.outputs.channel != 'canary' && steps.plan.outputs.channel != 'custom' run: pnpm run test:ut - name: Build documentation if: steps.plan.outputs.channel != 'canary' && steps.plan.outputs.channel != 'custom' run: pnpm run build:docs - name: Check documentation bundle if: steps.plan.outputs.channel != 'canary' && steps.plan.outputs.channel != 'custom' run: pnpm run check-doc-bundle - name: Pack and verify all canary tarballs env: EXPECTED_PLAN_HASH: ${{ steps.plan.outputs.plan_hash }} run: node scripts/canary-release/release.mjs pack --staging --expected-plan-hash "$EXPECTED_PLAN_HASH" - name: Upload verified tarballs and manifest # Verified via GitHub API: actions/upload-artifact git/ref/tags/v4. uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with: name: canary-tarballs-${{ github.run_id }}-${{ github.run_attempt }} path: .release/artifacts/* include-hidden-files: true if-no-files-found: error retention-days: 14 compression-level: 0 - name: Upload manifest for the trigger client uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with: name: canary-manifest-${{ steps.plan.outputs.release_id }} path: .release/artifacts/manifest.json include-hidden-files: true if-no-files-found: error retention-days: 30