mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-04 08:42:38 +00:00
fix: correct dry-run order and handle checked-out stale branch in devtools release
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Vulnerability Scan / pip-audit (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Vulnerability Scan / pip-audit (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
- Move _update_all_versions inside each dry-run branch so output order matches actual execution - Switch to main before deleting the stale local branch in create_or_reset_branch
This commit is contained in:
@@ -247,6 +247,14 @@ def create_or_reset_branch(branch: str, cwd: Path | None = None) -> None:
|
|||||||
remote_exists = False
|
remote_exists = False
|
||||||
|
|
||||||
if local_exists:
|
if local_exists:
|
||||||
|
current = run_command(
|
||||||
|
["git", "rev-parse", "--abbrev-ref", "HEAD"], cwd=cwd
|
||||||
|
).strip()
|
||||||
|
if current == branch:
|
||||||
|
console.print(
|
||||||
|
f"[yellow]![/yellow] Currently on {branch}, switching to main before delete"
|
||||||
|
)
|
||||||
|
run_command(["git", "checkout", "main"], cwd=cwd)
|
||||||
console.print(f"[yellow]![/yellow] Deleting local branch {branch}")
|
console.print(f"[yellow]![/yellow] Deleting local branch {branch}")
|
||||||
run_command(["git", "branch", "-D", branch], cwd=cwd)
|
run_command(["git", "branch", "-D", branch], cwd=cwd)
|
||||||
|
|
||||||
@@ -2019,9 +2027,8 @@ def release(
|
|||||||
create_or_reset_branch(branch_name)
|
create_or_reset_branch(branch_name)
|
||||||
console.print("[green]✓[/green] Branch created")
|
console.print("[green]✓[/green] Branch created")
|
||||||
|
|
||||||
_update_all_versions(cwd, lib_dir, version, packages, dry_run)
|
_update_all_versions(cwd, lib_dir, version, packages, dry_run)
|
||||||
|
|
||||||
if not dry_run:
|
|
||||||
console.print("\nCommitting changes...")
|
console.print("\nCommitting changes...")
|
||||||
run_command(["git", "add", "."])
|
run_command(["git", "add", "."])
|
||||||
run_command(["git", "commit", "-m", f"feat: bump versions to {version}"])
|
run_command(["git", "commit", "-m", f"feat: bump versions to {version}"])
|
||||||
@@ -2051,6 +2058,7 @@ def release(
|
|||||||
_poll_pr_until_merged(branch_name, "bump PR")
|
_poll_pr_until_merged(branch_name, "bump PR")
|
||||||
else:
|
else:
|
||||||
console.print(f"[dim][DRY RUN][/dim] Would create branch: {branch_name}")
|
console.print(f"[dim][DRY RUN][/dim] Would create branch: {branch_name}")
|
||||||
|
_update_all_versions(cwd, lib_dir, version, packages, dry_run)
|
||||||
console.print(
|
console.print(
|
||||||
f"[dim][DRY RUN][/dim] Would commit: feat: bump versions to {version}"
|
f"[dim][DRY RUN][/dim] Would commit: feat: bump versions to {version}"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user