build #38
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| push: | |
| tags: ['v*'] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| # Fail fast instead of burning hours: a healthy build is well under 30 min. | |
| # (A runaway universal+LTO macOS build once ran ~3h before this cap existed.) | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { os: ubuntu-22.04, name: linux-x86_64 } | |
| - { os: windows-2022, name: win64 } | |
| - { os: macos-14, name: macos-universal } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Lint (ASCII-only string literals) | |
| shell: bash | |
| run: python3 tools/check-no-utf8-strings.py | |
| - name: Linux deps | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libasound2-dev libjack-jackd2-dev \ | |
| libfreetype6-dev libfontconfig1-dev \ | |
| libx11-dev libxcomposite-dev libxcursor-dev libxext-dev \ | |
| libxinerama-dev libxrandr-dev libxrender-dev \ | |
| libwebkit2gtk-4.1-dev libglu1-mesa-dev \ | |
| libcurl4-openssl-dev mesa-common-dev ninja-build | |
| - name: Configure | |
| shell: bash | |
| run: | | |
| EXTRA="" | |
| # LTO buys a JUCE plugin negligible runtime benefit but is a huge | |
| # build-time cost. On the universal (2-arch) macOS build it turned a | |
| # ~24min build into a ~3h one. Disable it everywhere but Windows | |
| # (which links fine with it in ~20min). | |
| if [ "$RUNNER_OS" != "Windows" ]; then EXTRA="-DBOMBO_LTO=OFF"; fi | |
| # macOS: one universal binary covers both Apple Silicon and Intel. | |
| if [ "$RUNNER_OS" = "macOS" ]; then EXTRA="$EXTRA -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64"; fi | |
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release $EXTRA | |
| - name: Build | |
| shell: bash | |
| run: | | |
| JOBS="-j" | |
| if [ "$RUNNER_OS" = "Linux" ]; then JOBS="-j 2"; fi | |
| # macos-14 has 3 cores; a bare -j lets make spawn an unbounded number of | |
| # heavy (universal = 2x) compiles at once and thrash into swap. Pin it. | |
| if [ "$RUNNER_OS" = "macOS" ]; then JOBS="-j 3"; fi | |
| cmake --build build --config Release $JOBS | |
| - name: Test | |
| shell: bash | |
| run: ctest --test-dir build --output-on-failure -C Release | |
| - name: Stage artefacts (Linux) | |
| if: ${{ always() && runner.os == 'Linux' }} | |
| shell: bash | |
| run: | | |
| A=build/Bombo_artefacts/Release | |
| mkdir -p pkg | |
| cp -r "$A/VST3/Bombo.vst3" pkg/ | |
| cp "$A/CLAP/Bombo.clap" pkg/ | |
| cp "$A/Standalone/Bombo" pkg/Bombo | |
| strip pkg/Bombo pkg/Bombo.clap pkg/Bombo.vst3/Contents/x86_64-linux/Bombo.so || true | |
| - name: Stage artefacts (Windows) | |
| if: ${{ always() && runner.os == 'Windows' }} | |
| shell: bash | |
| run: | | |
| A=build/Bombo_artefacts/Release | |
| mkdir -p pkg | |
| cp -r "$A/VST3/Bombo.vst3" pkg/ | |
| cp "$A/CLAP/Bombo.clap" pkg/ | |
| cp "$A/Standalone/Bombo.exe" pkg/Bombo.exe | |
| - name: Stage artefacts (macOS, universal + ad-hoc sign) | |
| if: ${{ always() && runner.os == 'macOS' }} | |
| shell: bash | |
| run: | | |
| A=build/Bombo_artefacts/Release | |
| mkdir -p pkg | |
| cp -R "$A/VST3/Bombo.vst3" pkg/ | |
| cp -R "$A/CLAP/Bombo.clap" pkg/ | |
| cp -R "$A/Standalone/Bombo.app" pkg/ | |
| [ -d "$A/AU/Bombo.component" ] && cp -R "$A/AU/Bombo.component" pkg/ || true | |
| # Ad-hoc sign so Gatekeeper loads it locally; real Developer ID | |
| # signing + notarization is the separate macos-signing-runbook step. | |
| for b in pkg/Bombo.vst3 pkg/Bombo.clap pkg/Bombo.app pkg/Bombo.component; do | |
| [ -e "$b" ] && codesign --force --deep --sign - "$b" || true | |
| done | |
| # Confirm the binary is genuinely universal (arm64 + x86_64). | |
| lipo -info "pkg/Bombo.vst3/Contents/MacOS/Bombo" || true | |
| - name: Upload artefacts | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bombo-${{ matrix.name }} | |
| path: pkg/ | |
| if-no-files-found: error |