Commit release preparation changes and optionally push the branch. Args: version: Release version without the leading `v`. branch: Release branch name. changelog_path: Changelog file created for this release. args: Parsed CLI arguments. Raises: Relea
(
version: str,
branch: str,
changelog_path: Path,
args: argparse.Namespace,
)
| 312 | |
| 313 | |
| 314 | def commit_and_maybe_push( |
| 315 | version: str, |
| 316 | branch: str, |
| 317 | changelog_path: Path, |
| 318 | args: argparse.Namespace, |
| 319 | ) -> None: |
| 320 | """Commit release preparation changes and optionally push the branch. |
| 321 | |
| 322 | Args: |
| 323 | version: Release version without the leading `v`. |
| 324 | branch: Release branch name. |
| 325 | changelog_path: Changelog file created for this release. |
| 326 | args: Parsed CLI arguments. |
| 327 | |
| 328 | Raises: |
| 329 | ReleaseError: Git add, commit, or push fails. |
| 330 | """ |
| 331 | git( |
| 332 | [ |
| 333 | "add", |
| 334 | "pyproject.toml", |
| 335 | "astrbot/__init__.py", |
| 336 | str(changelog_path.relative_to(REPO_ROOT)), |
| 337 | ] |
| 338 | ) |
| 339 | if args.generate_api_client: |
| 340 | git(["add", "dashboard/src/api/generated"]) |
| 341 | |
| 342 | git(["commit", "-m", f"chore: bump version to {version}"]) |
| 343 | if args.push: |
| 344 | git(["push", "-u", args.remote, branch]) |
| 345 | |
| 346 | |
| 347 | def print_next_steps( |