Skip to content

Commit

Permalink
updated build script file names
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerFlar committed Jan 13, 2025
1 parent 361c8d7 commit 5fc82db
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
15 changes: 13 additions & 2 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand All @@ -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",
Expand Down

0 comments on commit 5fc82db

Please sign in to comment.