Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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]
10 changes: 5 additions & 5 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions scripts/release-workflows.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Loading