feat: Update application version to 0.5.0 and refactor version syncing script
This commit is contained in:
parent
dffc925bb6
commit
ff804790e6
4 changed files with 23 additions and 22 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Application
|
# Application
|
||||||
APP_NAME=WebDrop Bridge
|
APP_NAME=WebDrop Bridge
|
||||||
APP_VERSION=0.1.0
|
APP_VERSION=0.5.0
|
||||||
|
|
||||||
# Web App
|
# Web App
|
||||||
WEBAPP_URL=file:///./webapp/index.html
|
WEBAPP_URL=file:///./webapp/index.html
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,13 @@ from pathlib import Path
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
# Import shared version utilities
|
# Import shared version utilities
|
||||||
from version_utils import get_current_version
|
from sync_version import get_current_version, sync_version
|
||||||
|
|
||||||
# Fix Unicode output on Windows
|
# Fix Unicode output on Windows (removed TextIOWrapper due to subprocess conflicts)
|
||||||
|
# TextIOWrapper causes issues when subprocess tries to write to file descriptors
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
import io
|
import os
|
||||||
|
os.environ["PYTHONIOENCODING"] = "utf-8"
|
||||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
|
|
||||||
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding="utf-8")
|
|
||||||
|
|
||||||
|
|
||||||
class WindowsBuilder:
|
class WindowsBuilder:
|
||||||
|
|
@ -116,8 +115,7 @@ class WindowsBuilder:
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
cmd,
|
cmd,
|
||||||
cwd=str(self.project_root),
|
cwd=str(self.project_root),
|
||||||
encoding="utf-8",
|
text=True,
|
||||||
errors="replace",
|
|
||||||
env=env
|
env=env
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -205,8 +203,7 @@ class WindowsBuilder:
|
||||||
print(f" Compiling WiX source...")
|
print(f" Compiling WiX source...")
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
candle_cmd,
|
candle_cmd,
|
||||||
encoding="utf-8",
|
text=True
|
||||||
errors="replace"
|
|
||||||
)
|
)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
print("❌ WiX compilation failed")
|
print("❌ WiX compilation failed")
|
||||||
|
|
@ -223,8 +220,7 @@ class WindowsBuilder:
|
||||||
print(f" Linking MSI installer...")
|
print(f" Linking MSI installer...")
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
light_cmd,
|
light_cmd,
|
||||||
encoding="utf-8",
|
text=True
|
||||||
errors="replace"
|
|
||||||
)
|
)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
print("❌ MSI linking failed")
|
print("❌ MSI linking failed")
|
||||||
|
|
@ -330,8 +326,7 @@ class WindowsBuilder:
|
||||||
|
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
cmd,
|
cmd,
|
||||||
encoding="utf-8",
|
text=True
|
||||||
errors="replace"
|
|
||||||
)
|
)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
print("❌ Code signing failed")
|
print("❌ Code signing failed")
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,17 @@ param(
|
||||||
|
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
# Get project root (PSScriptRoot is build/scripts, go up to project root with ..\..)
|
||||||
|
$projectRoot = Resolve-Path (Join-Path $PSScriptRoot "..\..")
|
||||||
|
|
||||||
|
# Resolve file paths relative to project root
|
||||||
|
$ExePath = Join-Path $projectRoot $ExePath
|
||||||
|
$ChecksumPath = Join-Path $projectRoot $ChecksumPath
|
||||||
|
$MsiPath = Join-Path $projectRoot $MsiPath
|
||||||
|
|
||||||
# Function to read version from .env or .env.example
|
# Function to read version from .env or .env.example
|
||||||
function Get-VersionFromEnv {
|
function Get-VersionFromEnv {
|
||||||
# PSScriptRoot is build/scripts, go up to project root with ../../
|
# Use already resolved project root
|
||||||
$projectRoot = Resolve-Path (Join-Path $PSScriptRoot "..\..")
|
|
||||||
|
|
||||||
# Try .env first (runtime config), then .env.example (template)
|
# Try .env first (runtime config), then .env.example (template)
|
||||||
$envFile = Join-Path $projectRoot ".env"
|
$envFile = Join-Path $projectRoot ".env"
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,8 @@ from pathlib import Path
|
||||||
|
|
||||||
# Enable UTF-8 output on Windows
|
# Enable UTF-8 output on Windows
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
import io
|
import os
|
||||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
|
os.environ["PYTHONIOENCODING"] = "utf-8"
|
||||||
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding="utf-8")
|
|
||||||
|
|
||||||
# Import shared version utilities
|
# Import shared version utilities
|
||||||
sys.path.insert(0, str(Path(__file__).parent.parent / "build" / "scripts"))
|
sys.path.insert(0, str(Path(__file__).parent.parent / "build" / "scripts"))
|
||||||
|
|
@ -131,7 +130,7 @@ def update_changelog(version: str) -> None:
|
||||||
print(f"✓ Added version header to CHANGELOG.md for {version}")
|
print(f"✓ Added version header to CHANGELOG.md for {version}")
|
||||||
|
|
||||||
|
|
||||||
def main() -> int:
|
def sync_version() -> int:
|
||||||
"""Sync version across project.
|
"""Sync version across project.
|
||||||
|
|
||||||
Updates __init__.py (source of truth) and changelog.
|
Updates __init__.py (source of truth) and changelog.
|
||||||
|
|
@ -176,4 +175,4 @@ def main() -> int:
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.exit(main())
|
sys.exit(sync_version())
|
||||||
Loading…
Add table
Add a link
Reference in a new issue