From 9f454fbed34f466a98e21101bff9b38d22ea7265 Mon Sep 17 00:00:00 2001 From: Anthony Samms Date: Mon, 15 Sep 2025 13:46:47 -0400 Subject: [PATCH] I hope it works --- .github/workflows/build_audio.yml | 46 -------------- .github/workflows/python-app.yml | 102 ++++++++++-------------------- 2 files changed, 33 insertions(+), 115 deletions(-) delete mode 100644 .github/workflows/build_audio.yml diff --git a/.github/workflows/build_audio.yml b/.github/workflows/build_audio.yml deleted file mode 100644 index d2375ed..0000000 --- a/.github/workflows/build_audio.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Build Audio Library (Windows MSYS2) - -on: - workflow_dispatch: - push: - paths: - - "libs/audio/**" - - ".github/workflows/build_audio.yml" - -jobs: - build-msys2: - runs-on: windows-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up MSYS2 - uses: msys2/setup-msys2@v2 - with: - update: true - install: >- - base-devel - mingw-w64-x86_64-gcc - mingw-w64-x86_64-portaudio - mingw-w64-x86_64-libsndfile - mingw-w64-x86_64-libsamplerate - - - name: Build audio library (DLL) - shell: msys2 {0} - working-directory: libs/audio - run: | - make clean - make all - - - name: List build outputs - shell: msys2 {0} - working-directory: libs/audio - run: | - ls -l - - - name: Upload DLL artifact - uses: actions/upload-artifact@v4 - with: - name: libaudio-dll - path: libs/audio/libaudio.dll diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 1168a52..378e7aa 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -37,41 +37,42 @@ jobs: brew update brew install portaudio libsndfile libsamplerate pkg-config - - name: Install Audio Dependencies (Windows) + # Use MSYS2 for Windows audio library build + - name: Set up MSYS2 (Windows) + if: runner.os == 'Windows' + uses: msys2/setup-msys2@v2 + with: + update: true + install: >- + base-devel + mingw-w64-x86_64-gcc + mingw-w64-x86_64-portaudio + mingw-w64-x86_64-libsndfile + mingw-w64-x86_64-libsamplerate + + - name: Build audio library (DLL) (Windows) + if: runner.os == 'Windows' + shell: msys2 {0} + working-directory: libs/audio + run: | + make clean + make all + + - name: List build outputs (Windows) + if: runner.os == 'Windows' + shell: msys2 {0} + working-directory: libs/audio + run: | + ls -l + + - name: Copy DLL to build directory (Windows) if: runner.os == 'Windows' run: | - # Install vcpkg dependencies - vcpkg integrate install - vcpkg install portaudio:x64-windows libsndfile:x64-windows libsamplerate:x64-windows + mkdir -p build/lib + cp libs/audio/libaudio.dll build/lib/ + shell: bash - # Set up environment variables for the build system - echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" >> $env:GITHUB_ENV - echo "VCPKG_INCLUDE_PATH=$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows/include" >> $env:GITHUB_ENV - echo "VCPKG_LIB_PATH=$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib" >> $env:GITHUB_ENV - echo "CMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" >> $env:GITHUB_ENV - - # Set up include and library paths - $vcpkgPath = "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows" - echo "CPPFLAGS=-I$vcpkgPath/include" >> $env:GITHUB_ENV - echo "LDFLAGS=-L$vcpkgPath/lib" >> $env:GITHUB_ENV - echo "PKG_CONFIG_PATH=$vcpkgPath/lib/pkgconfig" >> $env:GITHUB_ENV - - # Add bin directory to PATH for runtime DLLs - echo "$vcpkgPath/bin" >> $env:GITHUB_PATH - shell: powershell - - # Set up build tools for Windows - - name: Setup MSVC (Windows) - if: runner.os == 'Windows' - uses: microsoft/setup-msbuild@v2 - - - name: Setup MSVC Environment (Windows) - if: runner.os == 'Windows' - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 - - # Compile the audio library + # Compile the audio library (Unix) - name: Check Audio Library Dependencies run: | cd libs/audio @@ -79,16 +80,6 @@ jobs: shell: bash continue-on-error: true - - name: Compile Audio Library (Windows) - if: runner.os == 'Windows' - run: | - cd libs/audio - make clean - make all - shell: cmd - env: - VCPKG_INSTALLATION_ROOT: ${{ env.VCPKG_ROOT }} - - name: Compile Audio Library (Unix) if: runner.os != 'Windows' run: | @@ -104,33 +95,6 @@ jobs: sudo make install shell: bash - - name: Setup Audio Library (Windows) - if: runner.os == 'Windows' - run: | - cd libs/audio - # Create build directory and copy library files - mkdir -p ../../build/lib - - # Copy the compiled library - if (Test-Path "libaudio.dll") { - Copy-Item "libaudio.dll" "../../build/lib/" - echo "Copied libaudio.dll" - } - - # Copy vcpkg DLLs that are needed at runtime - $vcpkgBin = "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin" - if (Test-Path $vcpkgBin) { - echo "Copying runtime DLLs from vcpkg..." - Get-ChildItem "$vcpkgBin/*.dll" | ForEach-Object { - Copy-Item $_.FullName "../../build/lib/" -ErrorAction SilentlyContinue - echo "Copied $($_.Name)" - } - } - - # Add to PATH - echo "${{ github.workspace }}/build/lib" >> $env:GITHUB_PATH - shell: powershell - - name: Install uv uses: astral-sh/setup-uv@v4