From 9ccea5f53fb4e4adb8051566fd20f2d1bf47b606 Mon Sep 17 00:00:00 2001 From: Aditya Mukhopadhyay Date: Tue, 1 Dec 2026 13:36:57 +0530 Subject: [PATCH] ci: run CI on maintenance branches and keep semver blocking there (#937) After the #937 move, this branch becomes `v2.x`. Pushes and pull requests there take their workflows from `v2.x` itself, but rust, lint, wasm and binary-size only triggered on `main`, and policy only on pushes to `main`. The release gate needs successful push runs of all six on the tagged commit, so a 2.x patch from `v2.x` could not be released. - rust, lint, wasm, binary-size: push and pull_request on `main` and `v[0-9]*`. - policy: push on `main` and `v[0-9]*`. The semver check stays a hard gate on a maintenance branch (`*.x`); only a major-version development branch (e.g. `v3`) keeps it advisory. Its baseline (latest reachable tag) is the latest 2.x release on `v2.x`. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01H2a7QngaFzuCVt5umd1qoh --- .github/workflows/binary-size.yml | 4 ++-- .github/workflows/lint.yml | 4 ++-- .github/workflows/policy.yml | 17 ++++++++++------- .github/workflows/rust.yml | 4 ++-- .github/workflows/wasm.yml | 4 ++-- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/binary-size.yml b/.github/workflows/binary-size.yml index 88f0369154..699f4fa705 100644 --- a/.github/workflows/binary-size.yml +++ b/.github/workflows/binary-size.yml @@ -2,9 +2,9 @@ name: Binary Size on: push: - branches: [ "main" ] + branches: [ "main", "v[0-9]*" ] pull_request: - branches: [ "main" ] + branches: [ "main", "v[0-9]*" ] permissions: contents: read diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b7b5ea0ab5..1257a29d30 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,9 +8,9 @@ name: Lint on: push: - branches: [ "main" ] + branches: [ "main", "v[0-9]*" ] pull_request: - branches: [ "main" ] + branches: [ "main", "v[0-9]*" ] permissions: contents: read diff --git a/.github/workflows/policy.yml b/.github/workflows/policy.yml index f4299138d0..aa946974e0 100644 --- a/.github/workflows/policy.yml +++ b/.github/workflows/policy.yml @@ -9,10 +9,11 @@ name: Policy on: push: - branches: [ "main" ] + branches: [ "main", "v[0-9]*" ] pull_request: - # Major-version branches (e.g. `v3`) run the same checks, but a semver - # break is allowed there — see the semver-checks job. + # Other branches run the same checks. A semver break is allowed only on a + # major-version development branch (e.g. `v3`), never on a maintenance + # branch (`v2.x`) — see the semver-checks job. branches: [ "main", "v[0-9]*" ] # A new advisory can land without a change here (default branch only). schedule: @@ -61,10 +62,12 @@ jobs: name: Public API semver check if: github.event_name != 'schedule' runs-on: ubuntu-latest - # A breaking change is only allowed on a major-version branch (e.g. `v3`). - # There the job still runs, so the break is visible, but it cannot fail - # the PR. On `main` it is a hard gate. - continue-on-error: ${{ github.event_name == 'pull_request' && github.base_ref != 'main' }} + # A breaking change is only allowed on a major-version development branch + # (e.g. `v3`). There the job still runs, so the break is visible, but it + # cannot fail the PR. On `main` and on a maintenance branch (`v2.x`, #937) + # it is a hard gate; the baseline is the latest tag reachable from the + # checkout, so on `v2.x` it is the latest 2.x release. + continue-on-error: ${{ github.event_name == 'pull_request' && github.base_ref != 'main' && !endsWith(github.base_ref, '.x') }} steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9ef15ea0cd..168779f4f0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,9 +2,9 @@ name: Rust on: push: - branches: [ "main" ] + branches: [ "main", "v[0-9]*" ] pull_request: - branches: [ "main" ] + branches: [ "main", "v[0-9]*" ] env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 68f6ab79b6..45bf7664e5 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -5,9 +5,9 @@ name: WASM on: push: - branches: [ "main" ] + branches: [ "main", "v[0-9]*" ] pull_request: - branches: [ "main" ] + branches: [ "main", "v[0-9]*" ] env: CARGO_TERM_COLOR: always