Skip to content

Commit 0038b2c

Browse files
authored
ci(release): harden stable release orchestration and recovery (#2908)
* ci(release): harden stable release orchestration and recovery * fix: lint * chore: fix dry run
1 parent bc9a71f commit 0038b2c

27 files changed

Lines changed: 1411 additions & 101 deletions

.github/workflows/release-cli.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# Auto-releases CLI on push to:
2-
# - main (@next channel)
3-
# - stable (@latest channel)
1+
# Auto-releases CLI on push to main (@next channel).
2+
# Stable releases are orchestrated centrally by release-stable.yml.
43
name: 📦 Release CLI
54

65
on:
76
push:
87
branches:
98
- main
10-
- stable
119
paths:
1210
# Keep in sync with apps/cli/.releaserc.cjs includePaths (patch-commit-filter).
1311
# Workflow paths trigger CI; includePaths control semantic-release commit analysis.
@@ -19,6 +17,7 @@ on:
1917
- 'packages/ai/**'
2018
- 'packages/word-layout/**'
2119
- 'packages/preset-geometry/**'
20+
- 'shared/**'
2221
- 'scripts/semantic-release/**'
2322
- 'pnpm-workspace.yaml'
2423
- '!**/*.md'
@@ -29,7 +28,7 @@ permissions:
2928
packages: write
3029

3130
concurrency:
32-
group: ${{ github.ref_name == 'stable' && 'release-stable-writeback' || format('{0}-{1}', github.workflow, github.ref) }}
31+
group: ${{ github.ref_name == 'stable' && 'release-stable' || format('{0}-{1}', github.workflow, github.ref) }}
3332
cancel-in-progress: ${{ github.ref_name != 'stable' }}
3433

3534
jobs:

.github/workflows/release-create.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ permissions:
1717
packages: write
1818

1919
concurrency:
20-
group: release-create-${{ github.ref }}
21-
cancel-in-progress: true
20+
group: ${{ github.ref_name == 'stable' && 'release-stable' || format('{0}-{1}', github.workflow, github.ref) }}
21+
cancel-in-progress: ${{ github.ref_name != 'stable' }}
2222

2323
jobs:
2424
release:
@@ -36,6 +36,12 @@ jobs:
3636
fetch-depth: 0
3737
token: ${{ steps.generate_token.outputs.token }}
3838

39+
- name: Refresh stable branch head
40+
if: github.ref_name == 'stable'
41+
run: |
42+
git fetch origin "${{ github.ref_name }}" --tags
43+
git checkout -B "${{ github.ref_name }}" "origin/${{ github.ref_name }}"
44+
3945
- uses: pnpm/action-setup@v4
4046

4147
- uses: actions/setup-node@v6

.github/workflows/release-esign.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Auto-releases on push to main (@next) or stable (@latest)
1+
# Auto-releases on push to main (@next).
2+
# Stable releases are orchestrated centrally by release-stable.yml.
23
name: 📦 Release esign
34

45
on:
56
push:
67
branches:
78
- main
8-
- stable
99
paths:
1010
- 'packages/esign/**'
1111
- 'packages/superdoc/**'
@@ -14,6 +14,7 @@ on:
1414
- 'packages/ai/**'
1515
- 'packages/word-layout/**'
1616
- 'packages/preset-geometry/**'
17+
- 'shared/**'
1718
- 'pnpm-workspace.yaml'
1819
- '!**/*.md'
1920
workflow_dispatch:
@@ -23,8 +24,8 @@ permissions:
2324
packages: write
2425

2526
concurrency:
26-
group: release-esign-${{ github.ref }}
27-
cancel-in-progress: true
27+
group: ${{ github.ref_name == 'stable' && 'release-stable' || format('{0}-{1}', github.workflow, github.ref) }}
28+
cancel-in-progress: ${{ github.ref_name != 'stable' }}
2829

2930
jobs:
3031
release:
@@ -42,6 +43,12 @@ jobs:
4243
fetch-depth: 0
4344
token: ${{ steps.generate_token.outputs.token }}
4445

46+
- name: Refresh stable branch head
47+
if: github.ref_name == 'stable'
48+
run: |
49+
git fetch origin "${{ github.ref_name }}" --tags
50+
git checkout -B "${{ github.ref_name }}" "origin/${{ github.ref_name }}"
51+
4552
- uses: pnpm/action-setup@v4
4653

4754
- uses: actions/setup-node@v6

.github/workflows/release-mcp.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ permissions:
1717
packages: write
1818

1919
concurrency:
20-
group: release-mcp-${{ github.ref }}
21-
cancel-in-progress: true
20+
group: ${{ github.ref_name == 'stable' && 'release-stable' || format('{0}-{1}', github.workflow, github.ref) }}
21+
cancel-in-progress: ${{ github.ref_name != 'stable' }}
2222

2323
jobs:
2424
release:
@@ -36,6 +36,12 @@ jobs:
3636
fetch-depth: 0
3737
token: ${{ steps.generate_token.outputs.token }}
3838

39+
- name: Refresh stable branch head
40+
if: github.ref_name == 'stable'
41+
run: |
42+
git fetch origin "${{ github.ref_name }}" --tags
43+
git checkout -B "${{ github.ref_name }}" "origin/${{ github.ref_name }}"
44+
3945
- uses: pnpm/action-setup@v4
4046

4147
- uses: actions/setup-node@v6

.github/workflows/release-react.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Auto-releases on push to main (@next) or stable (@latest)
1+
# Auto-releases on push to main (@next).
2+
# Stable releases are orchestrated centrally by release-stable.yml.
23
name: 📦 Release react
34

45
on:
56
push:
67
branches:
78
- main
8-
- stable
99
paths:
1010
- 'packages/react/**'
1111
- 'packages/superdoc/**'
@@ -14,6 +14,7 @@ on:
1414
- 'packages/ai/**'
1515
- 'packages/word-layout/**'
1616
- 'packages/preset-geometry/**'
17+
- 'shared/**'
1718
- 'pnpm-workspace.yaml'
1819
- '!**/*.md'
1920
workflow_dispatch:
@@ -23,8 +24,8 @@ permissions:
2324
packages: write
2425

2526
concurrency:
26-
group: release-react-${{ github.ref }}
27-
cancel-in-progress: true
27+
group: ${{ github.ref_name == 'stable' && 'release-stable' || format('{0}-{1}', github.workflow, github.ref) }}
28+
cancel-in-progress: ${{ github.ref_name != 'stable' }}
2829

2930
jobs:
3031
release:
@@ -42,6 +43,12 @@ jobs:
4243
fetch-depth: 0
4344
token: ${{ steps.generate_token.outputs.token }}
4445

46+
- name: Refresh stable branch head
47+
if: github.ref_name == 'stable'
48+
run: |
49+
git fetch origin "${{ github.ref_name }}" --tags
50+
git checkout -B "${{ github.ref_name }}" "origin/${{ github.ref_name }}"
51+
4552
- uses: pnpm/action-setup@v4
4653

4754
- uses: actions/setup-node@v6

.github/workflows/release-sdk.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
# Auto-releases SDK on push to:
2-
# - main (@next channel)
3-
# - stable (@latest channel)
1+
# Auto-releases SDK on push to main (@next channel).
2+
# Stable releases are orchestrated centrally by release-stable.yml.
43
# Also supports manual dispatch as a fallback for one-off releases.
54
name: "\U0001F4E6 Release SDK"
65

76
on:
87
push:
98
branches:
109
- main
11-
- stable
1210
paths:
1311
# Keep in sync with packages/sdk/.releaserc.cjs includePaths (patch-commit-filter).
1412
- 'packages/sdk/**'
@@ -20,22 +18,23 @@ on:
2018
- 'packages/ai/**'
2119
- 'packages/word-layout/**'
2220
- 'packages/preset-geometry/**'
21+
- 'shared/**'
2322
- 'scripts/semantic-release/**'
2423
- 'pnpm-workspace.yaml'
2524
- '!**/*.md'
2625
workflow_dispatch:
2726
inputs:
2827
version:
29-
description: "Version to release (e.g. 1.0.0-next.7). Leave empty to publish the current repo version."
28+
description: 'Version to release (e.g. 1.0.0-next.7). Leave empty to publish the current repo version.'
3029
required: false
3130
type: string
3231
dry-run:
33-
description: "Dry run — build and validate without publishing"
32+
description: 'Dry run — build and validate without publishing'
3433
required: false
3534
type: boolean
3635
default: false
3736
npm-tag:
38-
description: "npm dist-tag for Node SDK publish (e.g. latest, next). Only used for manual version override."
37+
description: 'npm dist-tag for Node SDK publish (e.g. latest, next). Only used for manual version override.'
3938
required: false
4039
type: string
4140
default: latest
@@ -46,7 +45,7 @@ permissions:
4645
id-token: write # PyPI trusted publishing (OIDC)
4746

4847
concurrency:
49-
group: ${{ github.ref_name == 'stable' && 'release-stable-writeback' || format('{0}-{1}', github.workflow, github.ref) }}
48+
group: ${{ github.ref_name == 'stable' && 'release-stable' || format('{0}-{1}', github.workflow, github.ref) }}
5049
cancel-in-progress: ${{ github.ref_name != 'stable' }}
5150

5251
jobs:
@@ -85,15 +84,15 @@ jobs:
8584
with:
8685
node-version-file: .nvmrc
8786
cache: pnpm
88-
registry-url: "https://registry.npmjs.org"
87+
registry-url: 'https://registry.npmjs.org'
8988

9089
- uses: oven-sh/setup-bun@v2
9190
with:
9291
bun-version: 1.3.12
9392

9493
- uses: actions/setup-python@v5
9594
with:
96-
python-version: "3.12"
95+
python-version: '3.12'
9796

9897
- name: Install canvas system dependencies
9998
run: |
@@ -233,15 +232,15 @@ jobs:
233232
with:
234233
node-version-file: .nvmrc
235234
cache: pnpm
236-
registry-url: "https://registry.npmjs.org"
235+
registry-url: 'https://registry.npmjs.org'
237236

238237
- uses: oven-sh/setup-bun@v2
239238
with:
240239
bun-version: 1.3.12
241240

242241
- uses: actions/setup-python@v5
243242
with:
244-
python-version: "3.12"
243+
python-version: '3.12'
245244

246245
- name: Install dependencies
247246
run: pnpm install --frozen-lockfile

0 commit comments

Comments
 (0)