From 1217f4f7bd73fcf767117999a1b7aeecdf985ab5 Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Thu, 3 Dec 2026 11:33:29 -0700 Subject: [PATCH] Create the version PR before main validation --- .github/workflows/version.yml | 15 +++++++++------ RELEASING.md | 10 +++++----- scripts/release-workflows.test.mjs | 6 ++++++ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 9f30b3be..02162303 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -12,13 +12,7 @@ permissions: contents: read jobs: - checks: - name: Validate - # Keep the same-commit syntax supported by actionlint's workflow parser. - uses: ./.github/workflows/pr.yml # zizmor: ignore[self-repository] - version: - needs: checks if: github.repository == 'TanStack/oracles' runs-on: ubuntu-latest permissions: @@ -41,3 +35,12 @@ jobs: title: 'ci: Version Packages' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + checks: + name: Validate + needs: version + # Open the version PR before the validation fan-out competes for runners. + # Still validate main if version PR maintenance fails. + if: ${{ !cancelled() }} + # Keep the same-commit syntax supported by actionlint's workflow parser. + uses: ./.github/workflows/pr.yml # zizmor: ignore[self-repository] diff --git a/RELEASING.md b/RELEASING.md index 2b7c2ca4..c9b2e697 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -24,9 +24,9 @@ Before the first release: Use a granular npm token with bypass 2FA enabled for automation. npm trusted publishers can be configured after the packages exist. -After this setup reaches `main`, the Version Packages workflow runs the same -checks and previews as a pull request, then opens **ci: Version Packages** -from `changeset-release/main`. Main pushes only create or update that PR; +After this setup reaches `main`, the Version Packages workflow opens or updates +**ci: Version Packages** from `changeset-release/main`, then runs the same +checks and previews as a pull request. Main pushes only maintain that PR; they cannot publish packages. Merging that version PR into `main` triggers the Release workflow. It accepts @@ -65,8 +65,8 @@ pnpm add -D @tanstack/eslint-plugin-oracles eslint 1. Run `pnpm changeset` with each user-facing change and select the affected packages and bump types. Commit the generated Markdown file with the change. -2. Merge the change to `main`. Once checks pass, Changesets updates the version - pull request with versions, changelogs, and the lockfile. +2. Merge the change to `main`. Changesets updates the version pull request + with versions, changelogs, and the lockfile before main validation starts. 3. Review and merge the `changeset-release/main` version pull request. That merge starts release validation, then publishes the merged package versions to npm and creates GitHub releases. diff --git a/scripts/release-workflows.test.mjs b/scripts/release-workflows.test.mjs index 1059c7af..924c5f00 100644 --- a/scripts/release-workflows.test.mjs +++ b/scripts/release-workflows.test.mjs @@ -70,6 +70,12 @@ test('only guarded publication jobs enter the release queue', () => { } }) +test('version PR maintenance precedes validation without suppressing checks after failure', () => { + assert.equal(version.jobs.version.needs, undefined) + assert.equal(version.jobs.checks.needs, 'version') + assert.equal(version.jobs.checks.if, '${{ !cancelled() }}') +}) + test('main pushes only maintain the version PR and releases use the merge commit', () => { const manifest = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')) assert.equal(manifest.scripts['changeset:publish'], 'changeset publish')