v1.8.8: auto-version bump + keycode-based Ctrl+key dispatch
- build.py auto-increments patch version on every build (--no-bump to skip) - Ctrl+C/V/D/L/Z routed by physical keycode, works with any keyboard layout - No more manual version bumping needed Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
41
build.py
41
build.py
@@ -9,15 +9,52 @@ Usage:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
# Add project root
|
# Add project root
|
||||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
sys.path.insert(0, PROJECT_DIR)
|
||||||
|
|
||||||
|
|
||||||
|
def auto_bump_version() -> str:
|
||||||
|
"""Auto-increment patch version in version.py on every build."""
|
||||||
|
ver_file = os.path.join(PROJECT_DIR, "version.py")
|
||||||
|
with open(ver_file, "r", encoding="utf-8") as f:
|
||||||
|
content = f.read()
|
||||||
|
|
||||||
|
match = re.search(r'__version__\s*=\s*"(\d+)\.(\d+)\.(\d+)"', content)
|
||||||
|
if not match:
|
||||||
|
print("ERROR: Cannot parse version from version.py")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
major, minor, patch = int(match.group(1)), int(match.group(2)), int(match.group(3))
|
||||||
|
new_patch = patch + 1
|
||||||
|
new_version = f"{major}.{minor}.{new_patch}"
|
||||||
|
|
||||||
|
content = re.sub(
|
||||||
|
r'__version__\s*=\s*"[\d.]+"',
|
||||||
|
f'__version__ = "{new_version}"',
|
||||||
|
content,
|
||||||
|
)
|
||||||
|
with open(ver_file, "w", encoding="utf-8") as f:
|
||||||
|
f.write(content)
|
||||||
|
|
||||||
|
print(f"Version bumped: {major}.{minor}.{patch} -> {new_version}")
|
||||||
|
return new_version
|
||||||
|
|
||||||
|
|
||||||
|
# Auto-bump unless --no-bump flag is passed
|
||||||
|
if "--no-bump" not in sys.argv:
|
||||||
|
_version = auto_bump_version()
|
||||||
|
else:
|
||||||
|
sys.argv.remove("--no-bump")
|
||||||
|
_version = None
|
||||||
|
|
||||||
from version import __version__, __app_name__
|
from version import __version__, __app_name__
|
||||||
|
|
||||||
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
DIST_DIR = os.path.join(PROJECT_DIR, "dist")
|
DIST_DIR = os.path.join(PROJECT_DIR, "dist")
|
||||||
BUILD_DIR = os.path.join(PROJECT_DIR, "build")
|
BUILD_DIR = os.path.join(PROJECT_DIR, "build")
|
||||||
RELEASES_DIR = os.path.join(PROJECT_DIR, "releases")
|
RELEASES_DIR = os.path.join(PROJECT_DIR, "releases")
|
||||||
|
|||||||
BIN
releases/ServerManager-v1.8.8-win-x64.exe
Normal file
BIN
releases/ServerManager-v1.8.8-win-x64.exe
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
"""Version info for ServerManager."""
|
"""Version info for ServerManager."""
|
||||||
|
|
||||||
__version__ = "1.8.7"
|
__version__ = "1.8.8"
|
||||||
__app_name__ = "ServerManager"
|
__app_name__ = "ServerManager"
|
||||||
__author__ = "aibot777"
|
__author__ = "aibot777"
|
||||||
__description__ = "Desktop GUI for managing remote servers"
|
__description__ = "Desktop GUI for managing remote servers"
|
||||||
|
|||||||
Reference in New Issue
Block a user