diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 274adcd..1742819 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,12 +34,12 @@ jobs: include: - os: windows-latest build_os: windows - artifact_name: rtt-gcs-windows.exe - release_name: RTT-GCS-windows-x64 + artifact_name: rtt-drone-gcs-windows.exe + release_name: RTT-Drone-GCS-windows-x64 - os: ubuntu-latest build_os: linux - artifact_name: rtt-gcs-linux - release_name: RTT-GCS-linux-x64 + artifact_name: rtt-drone-gcs-linux + release_name: RTT-Drone-GCS-linux-x64 runs-on: ${{ matrix.os }} diff --git a/scripts/build.py b/scripts/build.py index 12624b9..d7fbafb 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -16,6 +16,16 @@ logger = logging.getLogger(__name__) +def get_executable_name(os_type: str) -> str: + """Get the executable name based on the OS.""" + if os_type == "windows": + return "rtt-drone-gcs-windows.exe" + if os_type == "linux": + return "rtt-drone-gcs-linux" + msg = f"Unsupported OS: {os_type}" + raise ValueError(msg) + + def validate_main_script(root_dir: Path) -> Path: """Validate and return the path to the main script.""" main_script = root_dir / "radio_telemetry_tracker_drone_gcs" / "main.py" @@ -35,7 +45,7 @@ def validate_output(dist_dir: Path) -> None: def main() -> None: """Build the executable using PyInstaller.""" parser = argparse.ArgumentParser() - parser.add_argument("--os", choices=["windows", "linux", "macos"], required=True) + parser.add_argument("--os", choices=["windows", "linux"], required=True) args = parser.parse_args() try: @@ -44,9 +54,10 @@ def main() -> None: frontend_dir = build_frontend() logger.info("Frontend build complete") + executable_name = get_executable_name(args.os) cmd = [ "pyinstaller", - f"--name={APP_NAME}", + f"--name={executable_name}", "--windowed", "--onefile", "--add-data",