Files
flowdeck/scripts/bump_version.py
T
bruno 94e5e9c9f4
FlowDeck CI / test (push) Failing after 4s
FlowDeck CI / docker (push) Has been skipped
chore: script bump_version.py — plus jamais oublier de bumper
2026-07-12 17:22:37 -04:00

31 lines
823 B
Python

#!/usr/bin/env python3
"""Bump FlowDeck version and create a git tag."""
import re, sys, subprocess
MAIN_FILE = "app/main.py"
with open(MAIN_FILE) as f:
content = f.read()
current = re.search(r'version="(\d+\.\d+\.\d+)"', content)
if not current:
print("Version not found in", MAIN_FILE)
sys.exit(1)
old_ver = current.group(1)
parts = old_ver.split(".")
if len(sys.argv) > 1:
new_ver = sys.argv[1]
else:
parts[-1] = str(int(parts[-1]) + 1)
new_ver = ".".join(parts)
new_content = content.replace(f'version="{old_ver}"', f'version="{new_ver}"')
with open(MAIN_FILE, "w") as f:
f.write(new_content)
subprocess.run(["git", "add", MAIN_FILE])
print(f"Bumped {old_ver} → {new_ver}")
print("Run: git commit -m 'chore: bump version {old_ver} → {new_ver}'")
print(f"And: git tag v{new_ver}")