Skip to content

Commit 8f824df

Browse files
stuchaincursoragent
andcommitted
Make prerelease the default branch: workflows trigger on main; add branch-rename scripts
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 3db4a35 commit 8f824df

8 files changed

Lines changed: 96 additions & 8 deletions

File tree

.github/workflows/build-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
tags:
66
- 'v*'
77
branches:
8-
- prerelease
8+
- main
99
workflow_dispatch:
1010

1111
jobs:

.github/workflows/build-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
tags:
66
- 'v*'
77
branches:
8-
- prerelease
8+
- main
99
workflow_dispatch:
1010

1111
jobs:

.github/workflows/docs-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Docs Check
33

44
on:
55
push:
6-
branches: ['main', 'prerelease']
6+
branches: ['main', 'main_deprecated']
77
paths: ['docs/**', '.github/**', '.lycheeignore']
88
pull_request:
9-
branches: ['main', 'prerelease']
9+
branches: ['main', 'main_deprecated']
1010
paths: ['docs/**', '.github/**', '.lycheeignore']
1111

1212
jobs:

.github/workflows/release-gates.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release Gates
33
on:
44
push:
55
branches:
6-
- prerelease
6+
- main
77
workflow_dispatch:
88

99
jobs:

.github/workflows/security-scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Security Scan
22

33
on:
44
push:
5-
branches: [main, prerelease, ship_v1.0, v1]
5+
branches: [main, main_deprecated, ship_v1.0, v1]
66
pull_request:
7-
branches: [main, prerelease, ship_v1.0, v1]
7+
branches: [main, main_deprecated, ship_v1.0, v1]
88
schedule:
99
- cron: '0 0 * * 0' # weekly
1010

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Test
22

33
on:
44
push:
5-
branches: ['main', 'prerelease', 'phase_*']
5+
branches: ['main', 'main_deprecated', 'phase_*']
66

77
jobs:
88
test:

scripts/make_prerelease_main.ps1

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Make prerelease the new main, and rename current main to main_deprecated.
2+
#
3+
# Run from repo root in PowerShell. Requires: no uncommitted changes, branches main + prerelease exist.
4+
# After running, push with: git push origin main_deprecated; git push origin main --force
5+
6+
$ErrorActionPreference = "Stop"
7+
8+
Write-Host "=== Make prerelease the main branch ===" -ForegroundColor Cyan
9+
Write-Host ""
10+
11+
# 1. Fetch latest
12+
git fetch origin
13+
if ($LASTEXITCODE -ne 0) { exit 1 }
14+
15+
# 2. Ensure we have origin/main and origin/prerelease
16+
$null = git rev-parse --verify origin/main 2>$null
17+
if ($LASTEXITCODE -ne 0) {
18+
Write-Host "Error: origin/main not found. Run: git fetch origin" -ForegroundColor Red
19+
exit 1
20+
}
21+
$null = git rev-parse --verify origin/prerelease 2>$null
22+
if ($LASTEXITCODE -ne 0) {
23+
Write-Host "Error: origin/prerelease not found. Run: git fetch origin" -ForegroundColor Red
24+
exit 1
25+
}
26+
27+
# 3. Switch to main and update
28+
git checkout main
29+
git pull origin main 2>$null
30+
31+
# 4. Rename current local main to main_deprecated
32+
git branch -m main main_deprecated
33+
Write-Host "Renamed local branch main -> main_deprecated" -ForegroundColor Green
34+
35+
# 5. Create new local main from origin/prerelease
36+
git checkout -b main origin/prerelease
37+
Write-Host "Created new local branch main from origin/prerelease" -ForegroundColor Green
38+
39+
# 6. Summary
40+
Write-Host ""
41+
Write-Host "Done. Next steps (run these to update the remote):" -ForegroundColor Yellow
42+
Write-Host " 1. Push the deprecated main: git push origin main_deprecated"
43+
Write-Host " 2. Force-push the new main: git push origin main --force"
44+
Write-Host " 3. (Optional) Delete remote prerelease: git push origin --delete prerelease"
45+
Write-Host ""

scripts/make_prerelease_main.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
# Make prerelease the new main, and rename current main to main_deprecated.
3+
#
4+
# Run from repo root. Requires: no uncommitted changes, and branches main + prerelease exist.
5+
# After running, push with: git push origin main_deprecated && git push origin main --force
6+
7+
set -e
8+
9+
echo "=== Make prerelease the main branch ==="
10+
echo ""
11+
12+
# 1. Fetch latest
13+
git fetch origin
14+
15+
# 2. Ensure we have origin/main and origin/prerelease
16+
if ! git rev-parse --verify origin/main >/dev/null 2>&1; then
17+
echo "Error: origin/main not found. Run: git fetch origin"
18+
exit 1
19+
fi
20+
if ! git rev-parse --verify origin/prerelease >/dev/null 2>&1; then
21+
echo "Error: origin/prerelease not found. Run: git fetch origin"
22+
exit 1
23+
fi
24+
25+
# 3. Current branch: switch to main (local) so we can rename it
26+
git checkout main
27+
git pull origin main 2>/dev/null || true
28+
29+
# 4. Rename current local main to main_deprecated
30+
git branch -m main main_deprecated
31+
echo "Renamed local branch main -> main_deprecated"
32+
33+
# 5. Create new local main from origin/prerelease
34+
git checkout -b main origin/prerelease
35+
echo "Created new local branch main from origin/prerelease"
36+
37+
# 6. Summary
38+
echo ""
39+
echo "Done. Next steps (run these to update the remote):"
40+
echo " 1. Push the deprecated main: git push origin main_deprecated"
41+
echo " 2. Force-push the new main: git push origin main --force"
42+
echo " 3. (Optional) Delete remote prerelease: git push origin --delete prerelease"
43+
echo ""

0 commit comments

Comments
 (0)