From 0cbd445c8dc10c9e73c0ffebc84517145cdc71a1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 2 Sep 2024 09:32:37 +1000 Subject: [PATCH] fixed CI --- .github/workflows/CI_build_linux.yml | 3 ++- .github/workflows/CI_build_windows.yml | 4 ++-- package/build.py | 12 ++++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI_build_linux.yml b/.github/workflows/CI_build_linux.yml index 77d8b0b..7d973fe 100644 --- a/.github/workflows/CI_build_linux.yml +++ b/.github/workflows/CI_build_linux.yml @@ -13,6 +13,7 @@ jobs: - name: install dependencies run: | + sudo apt install alsa-base libasound2-dev python3-tk python3-numpy python3 -m pip install pyinstaller simpleaudio setuptools - name: Build CI @@ -22,7 +23,7 @@ jobs: - name: Archive build uses: actions/upload-artifact@v3 with: - name: ESC unlocker + name: ESC unlocker Linux path: | esc_unlocker_linux retention-days: 7 diff --git a/.github/workflows/CI_build_windows.yml b/.github/workflows/CI_build_windows.yml index d958dbc..4a1f73a 100644 --- a/.github/workflows/CI_build_windows.yml +++ b/.github/workflows/CI_build_windows.yml @@ -13,7 +13,7 @@ jobs: - name: install dependencies run: | - python3 -m pip install pyinstaller simpleaudio setuptools + python3 -m pip install pyinstaller simpleaudio setuptools tk numpy - name: Build CI run: | @@ -22,7 +22,7 @@ jobs: - name: Archive build uses: actions/upload-artifact@v3 with: - name: ESC unlocker + name: ESC unlocker windows path: | esc_unlocker_windows.exe retention-days: 7 diff --git a/package/build.py b/package/build.py index 79f882b..519a280 100755 --- a/package/build.py +++ b/package/build.py @@ -11,9 +11,17 @@ MCUPath = "MCU" # Initialize the options for PyInstaller -options = "--onefile --windowed --hidden-import=simpleaudio --add-data=tools/windows:tools/windows --add-data bootloaders:bootloaders --add-data probes:probes" +options = "--onefile --windowed --hidden-import=simpleaudio --add-data bootloaders:bootloaders --add-data probes:probes" -shutil.rmtree("dist") +if is_windows: + options += " --add-data=tools/windows:tools/windows" +else: + options += " --add-data=tools/linux:tools/linux" + +try: + shutil.rmtree("dist") +except Exception: + pass # Get the list of subdirectories in the MCU directory if os.path.exists(MCUPath):