From c7f3aeb4fc2893664ef14dd7e78f069a2503c490 Mon Sep 17 00:00:00 2001 From: Anthony Samms Date: Mon, 15 Sep 2025 11:52:41 -0400 Subject: [PATCH] :( --- .github/workflows/build_audio.yml | 147 ++++++++++++++++++++++++++++++ libs/audio/Makefile | 2 +- 2 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build_audio.yml diff --git a/.github/workflows/build_audio.yml b/.github/workflows/build_audio.yml new file mode 100644 index 0000000..e11fb6b --- /dev/null +++ b/.github/workflows/build_audio.yml @@ -0,0 +1,147 @@ +# GitHub Actions workflow for building audio library +name: Build Audio Library + +on: + push: + branches: [main, develop] + paths: + - "libs/audio/**" + - ".github/workflows/build-audio.yml" + pull_request: + branches: [main, develop] + paths: + - "libs/audio/**" + - ".github/workflows/build-audio.yml" + workflow_dispatch: # Allow manual triggering + +jobs: + build-linux: + name: Build on Linux + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + pkg-config \ + libportaudio19-dev \ + libsndfile1-dev \ + libsamplerate0-dev \ + libasound2-dev + + - name: Check dependencies + run: make -C libs/audio check-deps + + - name: Build library + run: make -C libs/audio all + + - name: Build debug version + run: make -C libs/audio debug + + - name: Test library exists + run: | + ls -la libs/audio/ + test -f libs/audio/libaudio.so + + - name: Upload Linux artifact + uses: actions/upload-artifact@v4 + with: + name: libaudio-linux + path: libs/audio/libaudio.so + retention-days: 30 + + build-windows: + name: Build on Windows + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup vcpkg + uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: "a42af01b72c28a8e1d7b48107b33e4f286a55ef6" + + - name: Install dependencies with vcpkg + run: | + vcpkg install portaudio:x64-windows + vcpkg install libsndfile:x64-windows + vcpkg install libsamplerate:x64-windows + + - name: Setup MSVC + uses: microsoft/setup-msbuild@v2 + + - name: Setup Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + + - name: Set vcpkg environment variables + shell: cmd + run: | + echo VCPKG_INSTALLATION_ROOT=%VCPKG_ROOT% >> %GITHUB_ENV% + echo VCPKG_INCLUDE_PATH=%VCPKG_ROOT%\installed\x64-windows\include >> %GITHUB_ENV% + echo VCPKG_LIB_PATH=%VCPKG_ROOT%\installed\x64-windows\lib >> %GITHUB_ENV% + + - name: Check dependencies + shell: cmd + run: make -C libs/audio check-deps + + - name: Build library + shell: cmd + run: make -C libs/audio all + + - name: Build debug version + shell: cmd + run: make -C libs/audio debug + + - name: Test library exists + shell: cmd + run: | + dir libs\audio\ + if not exist "libs\audio\libaudio.dll" exit /b 1 + + - name: Upload Windows artifact + uses: actions/upload-artifact@v4 + with: + name: libaudio-windows + path: libs/audio/libaudio.dll + retention-days: 30 + + build-summary: + name: Build Summary + runs-on: ubuntu-latest + needs: [build-linux, build-windows] + if: always() + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + + - name: Display build results + run: | + echo "## Build Results" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + if [ -f libaudio-linux/libaudio.so ]; then + echo "✅ Linux build: SUCCESS" >> $GITHUB_STEP_SUMMARY + ls -lh libaudio-linux/libaudio.so >> $GITHUB_STEP_SUMMARY + else + echo "❌ Linux build: FAILED" >> $GITHUB_STEP_SUMMARY + fi + + if [ -f libaudio-windows/libaudio.dll ]; then + echo "✅ Windows build: SUCCESS" >> $GITHUB_STEP_SUMMARY + ls -lh libaudio-windows/libaudio.dll >> $GITHUB_STEP_SUMMARY + else + echo "❌ Windows build: FAILED" >> $GITHUB_STEP_SUMMARY + fi + + echo "" >> $GITHUB_STEP_SUMMARY + echo "Artifacts are available for download from the Actions page." >> $GITHUB_STEP_SUMMARY diff --git a/libs/audio/Makefile b/libs/audio/Makefile index e28e95c..d9daee8 100644 --- a/libs/audio/Makefile +++ b/libs/audio/Makefile @@ -8,7 +8,7 @@ LIBS = -lportaudio -lsndfile -lsamplerate -lpthread -lm # Detect OS and set appropriate flags UNAME_S := $(shell uname -s 2>/dev/null || echo Windows) -# Windows detection (including GitHub Actions Windows runners) +# Windows detection ifneq (,$(findstring Windows,$(UNAME_S))) # Windows with MSVC CC = cl