Add build.sh wrapper that bumps the explicit dev/test build segment (scripts/bump-dev-build.py) for test builds and validates release version state (scripts/check-release-version.py) for releases. Update build-and-push.sh accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
21 lines
628 B
Python
Executable File
21 lines
628 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""Increment Novela's explicit dev/test build number."""
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
VERSION_FILE = ROOT / "containers" / "novela" / "version.py"
|
|
|
|
text = VERSION_FILE.read_text()
|
|
match = re.search(r"^BUILD = (\d+)\s*$", text, flags=re.MULTILINE)
|
|
if not match:
|
|
raise SystemExit(f"BUILD assignment not found in {VERSION_FILE}")
|
|
|
|
next_build = int(match.group(1)) + 1
|
|
text = text[: match.start(1)] + str(next_build) + text[match.end(1) :]
|
|
VERSION_FILE.write_text(text)
|
|
|
|
print(f"[bump-dev-build] BUILD = {next_build}")
|