From dc992b390ad758f1cfe06826b00a5083bf0559d1 Mon Sep 17 00:00:00 2001 From: Lance Jordan Date: Fri, 29 Aug 2025 18:17:02 -0400 Subject: [PATCH 1/2] Fix builds --- .github/workflows/build.yml | 198 +++++++++++++++++++++++++++++ .github/workflows/master-build.yml | 144 --------------------- 2 files changed, 198 insertions(+), 144 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/master-build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..918e572 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,198 @@ +# .github/workflows/build.yml +# Standard CMake-based build workflow +name: Build + +on: + push: + branches: [ master, main ] + pull_request: + branches: [ master, main ] + +jobs: + build: + strategy: + fail-fast: false # Don't cancel other jobs if one fails + matrix: + config: + - name: "Windows x64" + os: windows-latest + cmake_generator: "Visual Studio 17 2022" + cmake_arch: -A x64 + artifact_name: windows-x64 + + - name: "Linux x64" + os: ubuntu-latest + cmake_generator: "Unix Makefiles" + cmake_arch: "" + artifact_name: linux-x64 + + - name: "macOS Universal" + os: macos-latest + cmake_generator: "Unix Makefiles" + cmake_arch: -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" + artifact_name: macos-universal + + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.name }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup CMake + uses: lukka/get-cmake@latest + + - name: Install Dependencies (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + libasound2-dev \ + libpulse-dev \ + libjack-jackd2-dev \ + portaudio19-dev \ + libsndfile1-dev \ + pkg-config + + - name: Install Dependencies (macOS) + if: runner.os == 'macOS' + run: | + brew install portaudio libsndfile pkg-config + + - name: Setup MSVC (Windows) + if: runner.os == 'Windows' + uses: microsoft/setup-msbuild@v2 + + - name: Check Repository Structure + shell: bash + run: | + echo "=== Repository Contents ===" + find . -maxdepth 2 -type f | head -20 + echo "" + echo "=== Looking for CMakeLists.txt ===" + find . -name "CMakeLists.txt" + echo "" + echo "=== Looking for source files ===" + find . -name "*.cpp" -o -name "*.h" -o -name "*.c" | head -10 + + - name: Configure CMake + shell: bash + run: | + cmake -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -G "${{ matrix.config.cmake_generator }}" \ + ${{ matrix.config.cmake_arch }} + + - name: Build + shell: bash + run: | + cmake --build build --config Release --parallel $(nproc 2>/dev/null || echo 4) + + - name: List Build Output + shell: bash + run: | + echo "=== Build Directory Contents ===" + find build -type f | head -20 + echo "" + echo "=== Looking for Executables ===" + find build -name "*.exe" -o \( -type f -executable \) | head -10 + + - name: Run Tests (if available) + shell: bash + working-directory: build + run: | + if [ -f "CTestTestfile.cmake" ] || [ -f "test/CTestTestfile.cmake" ]; then + ctest --output-on-failure -C Release + else + echo "No tests found - skipping" + fi + continue-on-error: true + + - name: Package Artifacts + shell: bash + run: | + # Create output directory + mkdir -p dist/audio-level-fixer-${{ matrix.config.artifact_name }} + cd dist/audio-level-fixer-${{ matrix.config.artifact_name }} + + # Copy executables + if [ "${{ runner.os }}" == "Windows" ]; then + find ../../build -name "*.exe" -exec cp {} . \; 2>/dev/null || true + find ../../build -name "*.dll" -exec cp {} . \; 2>/dev/null || true + else + find ../../build -type f -executable -exec cp {} . \; 2>/dev/null || true + fi + + # Copy preset files and documentation + cp ../../*.preset . 2>/dev/null || true + cp ../../README.md . 2>/dev/null || true + cp ../../LICENSE* . 2>/dev/null || true + + # Show what we packaged + echo "=== Packaged Files ===" + ls -la + + # Create archive + cd .. + if [ "${{ runner.os }}" == "Windows" ]; then + 7z a audio-level-fixer-${{ matrix.config.artifact_name }}.zip audio-level-fixer-${{ matrix.config.artifact_name }}/* + else + tar -czf audio-level-fixer-${{ matrix.config.artifact_name }}.tar.gz audio-level-fixer-${{ matrix.config.artifact_name }}/ + fi + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: audio-level-fixer-${{ matrix.config.artifact_name }} + path: | + dist/*.zip + dist/*.tar.gz + retention-days: 30 + + # Only create release on pushes to main/master (not PRs) + release: + if: github.event_name == 'push' + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download All Artifacts + uses: actions/download-artifact@v4 + + - name: Display Structure + run: | + echo "Downloaded artifacts:" + find . -name "*.zip" -o -name "*.tar.gz" + + - name: Generate Release Notes + run: | + echo "# Audio Level Fixer - Development Build" > release-notes.md + echo "" >> release-notes.md + echo "**Build Information:**" >> release-notes.md + echo "- Commit: \`${{ github.sha }}\`" >> release-notes.md + echo "- Date: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" >> release-notes.md + echo "- Workflow: [\#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> release-notes.md + echo "" >> release-notes.md + echo "**Platforms Built:**" >> release-notes.md + echo "- ?? Windows x64" >> release-notes.md + echo "- ?? Linux x64" >> release-notes.md + echo "- ?? macOS Universal (Intel + Apple Silicon)" >> release-notes.md + echo "" >> release-notes.md + echo "> **Note:** This is an automated development build. The project is under active development." >> release-notes.md + + - name: Create Development Release + uses: softprops/action-gh-release@v1 + with: + tag_name: dev-${{ github.run_number }}-${{ github.run_attempt }} + name: "Development Build #${{ github.run_number }}" + body_path: release-notes.md + prerelease: true + files: | + **/*.zip + **/*.tar.gz + fail_on_unmatched_files: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/master-build.yml b/.github/workflows/master-build.yml deleted file mode 100644 index 7340ee2..0000000 --- a/.github/workflows/master-build.yml +++ /dev/null @@ -1,144 +0,0 @@ -# .github/workflows/master-build.yml -# Simpler version - only builds on master/main branch pushes -name: Master Build - -on: - push: - branches: [ master, main ] - -jobs: - build-all-platforms: - strategy: - matrix: - include: - - os: windows-latest - name: windows - cmake_generator: "Visual Studio 17 2022" - cmake_arch: "-A x64" - executable_ext: ".exe" - archive_cmd: "7z a audio-level-fixer-windows.zip audio-level-fixer-windows/*" - - - os: ubuntu-latest - name: linux - cmake_generator: "" - cmake_arch: "" - executable_ext: "" - deps: "sudo apt-get update && sudo apt-get install -y cmake build-essential libasound2-dev libpulse-dev portaudio19-dev" - archive_cmd: "tar -czf audio-level-fixer-linux.tar.gz audio-level-fixer-linux/" - - - os: macos-latest - name: macos-universal - cmake_generator: "" - cmake_arch: "-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64" - executable_ext: "" - deps: "brew install cmake portaudio" - archive_cmd: "tar -czf audio-level-fixer-macos.tar.gz audio-level-fixer-macos/" - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout Code - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 - with: - submodules: recursive - - - name: Install Dependencies - if: matrix.deps - run: ${{ matrix.deps }} - - - name: Setup MSVC (Windows only) - if: matrix.os == 'windows-latest' - uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce - - - name: Configure CMake - run: | - cmake -B build -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_generator }} ${{ matrix.cmake_arch }} - - - name: Build - run: cmake --build build --config Release - - - name: Package - shell: bash - run: | - mkdir audio-level-fixer-${{ matrix.name }} - - # Copy executables (try different possible names) - find build -name "*audio-level-fixer*" -executable -type f -exec cp {} audio-level-fixer-${{ matrix.name }}/ \; 2>/dev/null || true - find build -name "*AudioLevelFixer*" -executable -type f -exec cp {} audio-level-fixer-${{ matrix.name }}/ \; 2>/dev/null || true - find build -name "*.exe" -exec cp {} audio-level-fixer-${{ matrix.name }}/ \; 2>/dev/null || true - find build -name "*.dll" -exec cp {} audio-level-fixer-${{ matrix.name }}/ \; 2>/dev/null || true - - # Copy preset files and documentation - cp *.preset audio-level-fixer-${{ matrix.name }}/ 2>/dev/null || true - cp README.md audio-level-fixer-${{ matrix.name }}/ 2>/dev/null || true - cp LICENSE.txt audio-level-fixer-${{ matrix.name }}/ - - # Make executables executable on Unix systems - if [[ "${{ matrix.os }}" != "windows-latest" ]]; then - chmod +x audio-level-fixer-${{ matrix.name }}/* 2>/dev/null || true - fi - - - name: Install 7z (Windows only) - if: matrix.name == 'windows' - shell: bash - run: | - if ! command -v 7z &> /dev/null; then - choco install 7zip - fi - - - name: Create Archive - shell: bash - run: ${{ matrix.archive_cmd }} - - - name: Upload Build Artifacts - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 - with: - name: audio-level-fixer-${{ matrix.name }} - path: | - *.zip - *.tar.gz - retention-days: 30 - - create-development-release: - needs: build-all-platforms - runs-on: ubuntu-latest - - steps: - - name: Checkout Code - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 - - - name: Download All Artifacts - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 - - - name: List Downloaded Files - run: find . -name "*.zip" -o -name "*.tar.gz" | head -20 - - - name: Generate Release Notes - run: | - echo "# Audio Level Fixer - Development Build" > release_notes.md - echo "" >> release_notes.md - echo "**Build Information:**" >> release_notes.md - echo "- Build Date: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" >> release_notes.md - echo "- Commit: \`${{ github.sha }}\`" >> release_notes.md - echo "- Branch: \`${{ github.ref_name }}\`" >> release_notes.md - echo "" >> release_notes.md - echo "**Platforms:**" >> release_notes.md - echo "- ✅ Windows (x64)" >> release_notes.md - echo "- ✅ Linux (x64)" >> release_notes.md - echo "- ✅ macOS (Universal Binary - Intel & Apple Silicon)" >> release_notes.md - echo "" >> release_notes.md - echo "**Note:** This is an automated development build. For stable releases, check the [Releases page](../../releases)." >> release_notes.md - - - name: Create Development Release - uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 - with: - tag_name: dev-build-${{ github.run_number }} - name: "Development Build #${{ github.run_number }}" - body_path: release_notes.md - draft: false - prerelease: true - files: | - **/*.zip - **/*.tar.gz - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 301993e07e3286b9d8c0aaa9c483c3b6d9b3ca79 Mon Sep 17 00:00:00 2001 From: Lance Jordan Date: Fri, 29 Aug 2025 18:23:15 -0400 Subject: [PATCH 2/2] PR comments --- .github/workflows/build.yml | 56 ++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 918e572..8c9c63d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,13 +37,32 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 with: submodules: recursive + - name: Cache CMake + uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 + with: + path: | + ~/.cmake + build/_deps + key: ${{ runner.os }}-cmake-${{ hashFiles('**/CMakeLists.txt') }} + restore-keys: | + ${{ runner.os }}-cmake- + - name: Setup CMake - uses: lukka/get-cmake@latest + uses: lukka/get-cmake@5c7ccde04b4c5e57fc14c1fb1c94877f0b939172 + - name: Cache APT packages (Linux) + if: runner.os == 'Linux' + uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 + with: + path: /var/cache/apt + key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/build.yml') }} + restore-keys: | + ${{ runner.os }}-apt- + - name: Install Dependencies (Linux) if: runner.os == 'Linux' run: | @@ -57,6 +76,17 @@ jobs: libsndfile1-dev \ pkg-config + - name: Cache Homebrew (macOS) + if: runner.os == 'macOS' + uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 + with: + path: | + ~/Library/Caches/Homebrew + /opt/homebrew/var/homebrew/locks + key: ${{ runner.os }}-brew-${{ hashFiles('.github/workflows/build.yml') }} + restore-keys: | + ${{ runner.os }}-brew- + - name: Install Dependencies (macOS) if: runner.os == 'macOS' run: | @@ -64,7 +94,7 @@ jobs: - name: Setup MSVC (Windows) if: runner.os == 'Windows' - uses: microsoft/setup-msbuild@v2 + uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce - name: Check Repository Structure shell: bash @@ -89,7 +119,7 @@ jobs: - name: Build shell: bash run: | - cmake --build build --config Release --parallel $(nproc 2>/dev/null || echo 4) + cmake --build build --config Release --parallel - name: List Build Output shell: bash @@ -109,7 +139,7 @@ jobs: else echo "No tests found - skipping" fi - continue-on-error: true + continue-on-error: false - name: Package Artifacts shell: bash @@ -129,7 +159,7 @@ jobs: # Copy preset files and documentation cp ../../*.preset . 2>/dev/null || true cp ../../README.md . 2>/dev/null || true - cp ../../LICENSE* . 2>/dev/null || true + cp ../../LICENSE* . # Show what we packaged echo "=== Packaged Files ===" @@ -138,13 +168,13 @@ jobs: # Create archive cd .. if [ "${{ runner.os }}" == "Windows" ]; then - 7z a audio-level-fixer-${{ matrix.config.artifact_name }}.zip audio-level-fixer-${{ matrix.config.artifact_name }}/* + powershell -Command "Compress-Archive -Path 'audio-level-fixer-${{ matrix.config.artifact_name }}/*' -DestinationPath 'audio-level-fixer-${{ matrix.config.artifact_name }}.zip'" else tar -czf audio-level-fixer-${{ matrix.config.artifact_name }}.tar.gz audio-level-fixer-${{ matrix.config.artifact_name }}/ fi - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 with: name: audio-level-fixer-${{ matrix.config.artifact_name }} path: | @@ -160,7 +190,7 @@ jobs: steps: - name: Download All Artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 - name: Display Structure run: | @@ -177,14 +207,14 @@ jobs: echo "- Workflow: [\#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> release-notes.md echo "" >> release-notes.md echo "**Platforms Built:**" >> release-notes.md - echo "- ?? Windows x64" >> release-notes.md - echo "- ?? Linux x64" >> release-notes.md - echo "- ?? macOS Universal (Intel + Apple Silicon)" >> release-notes.md + echo "- ✅ Windows x64" >> release-notes.md + echo "- ✅ Linux x64" >> release-notes.md + echo "- ✅ macOS Universal (Intel + Apple Silicon)" >> release-notes.md echo "" >> release-notes.md echo "> **Note:** This is an automated development build. The project is under active development." >> release-notes.md - name: Create Development Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 with: tag_name: dev-${{ github.run_number }}-${{ github.run_attempt }} name: "Development Build #${{ github.run_number }}"