Release #9
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+' | |
| # Lets the three builds (and the macOS verification) be exercised by hand | |
| # without publishing a release. | |
| workflow_dispatch: | |
| env: | |
| JUCE_VERSION: 8.0.12 | |
| jobs: | |
| # ── Linux x86_64 ────────────────────────────────────────────────────────── | |
| build-linux-x86_64: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y \ | |
| libasound2-dev libx11-dev libxrandr-dev libxinerama-dev \ | |
| libxcursor-dev libfreetype-dev libfontconfig1-dev libgl1-mesa-dev \ | |
| libcurl4-openssl-dev libwebkit2gtk-4.1-dev | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: Mechanodd | |
| submodules: recursive | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: juce-framework/JUCE | |
| ref: ${{ env.JUCE_VERSION }} | |
| path: JUCE | |
| - name: Configure & Build | |
| run: | | |
| cmake -B Mechanodd/build -S Mechanodd -DCMAKE_BUILD_TYPE=Release | |
| # The embedded WAV/IR binary-data target is RAM-hungry — build it alone first. | |
| cmake --build Mechanodd/build --config Release --target MechanOddBinaryData --parallel 1 | |
| # Build the rest (capped at 2 to stay within the runner's RAM). | |
| cmake --build Mechanodd/build --config Release --parallel 2 | |
| - name: Package | |
| run: | | |
| ART=Mechanodd/build/MechanOdd_artefacts/Release | |
| mkdir -p staging | |
| cp -r "$ART/VST3/MechanOdd.vst3" staging/ | |
| cp -r "$ART/Standalone/MechanOdd" staging/ | |
| zip -r ${{ github.workspace }}/MechanOdd-Linux-x86_64.zip staging/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-x86_64 | |
| path: MechanOdd-Linux-x86_64.zip | |
| # ── Windows x86_64 ──────────────────────────────────────────────────────── | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: Mechanodd | |
| submodules: recursive | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: juce-framework/JUCE | |
| ref: ${{ env.JUCE_VERSION }} | |
| path: JUCE | |
| - name: Set up MSVC environment | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: x64 | |
| - name: Configure & Build | |
| run: | | |
| cmake -B Mechanodd/build -S Mechanodd -G Ninja -DCMAKE_BUILD_TYPE=Release | |
| cmake --build Mechanodd/build --target MechanOddBinaryData --parallel 1 | |
| cmake --build Mechanodd/build --parallel | |
| - name: Package | |
| shell: bash | |
| run: | | |
| ART=Mechanodd/build/MechanOdd_artefacts/Release | |
| mkdir -p staging | |
| cp -r "$ART/VST3/MechanOdd.vst3" staging/ | |
| cp -r "$ART/Standalone/MechanOdd.exe" staging/ | |
| 7z a MechanOdd-Windows-x86_64.zip ./staging/* | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-x86_64 | |
| path: MechanOdd-Windows-x86_64.zip | |
| # ── macOS universal (arm64 + x86_64) ────────────────────────────────────── | |
| build-macos: | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: Mechanodd | |
| submodules: recursive | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: juce-framework/JUCE | |
| ref: ${{ env.JUCE_VERSION }} | |
| path: JUCE | |
| - name: Configure & Build | |
| run: | | |
| # The architectures and deployment target are also set before | |
| # project() in CMakeLists.txt. Passing them here as well is belt and | |
| # braces: a command-line -D is in the cache before any CMakeLists | |
| # line runs, so it cannot be lost to file ordering. | |
| cmake -B Mechanodd/build -S Mechanodd \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ | |
| -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 | |
| cmake --build Mechanodd/build --config Release --target MechanOddBinaryData --parallel 1 | |
| # Capped at 2 (universal-binary builds double the compile/link load). | |
| cmake --build Mechanodd/build --config Release --parallel 2 | |
| # A verification step that cannot fail is not one: lipo -info printing | |
| # "arm64" while the job goes green is exactly how a broken release ships. | |
| # All three bundles are checked — they are separate link steps. | |
| - name: Verify universal binaries | |
| run: | | |
| set -euo pipefail | |
| ART=Mechanodd/build/MechanOdd_artefacts/Release | |
| status=0 | |
| for bundle in \ | |
| "$ART/VST3/MechanOdd.vst3/Contents/MacOS/MechanOdd" \ | |
| "$ART/AU/MechanOdd.component/Contents/MacOS/MechanOdd" \ | |
| "$ART/Standalone/MechanOdd.app/Contents/MacOS/MechanOdd" | |
| do | |
| if [[ ! -f "$bundle" ]]; then | |
| echo "::error::missing binary: $bundle"; status=1; continue | |
| fi | |
| info=$(lipo -info "$bundle") | |
| echo "$info" | |
| for arch in x86_64 arm64; do | |
| grep -qw "$arch" <<< "$info" || { echo "::error::$bundle has no $arch slice"; status=1; } | |
| done | |
| vtool -show-build "$bundle" | grep -E 'minos|platform' || true | |
| done | |
| exit $status | |
| # Ad-hoc signature: free, no Apple account. It only makes each bundle | |
| # internally consistent (arm64 code needs *some* signature to run, and | |
| # packaging can invalidate the linker's). It is not notarisation and does | |
| # nothing for Gatekeeper — see the README's macOS install note. | |
| - name: Ad-hoc codesign | |
| run: | | |
| set -euo pipefail | |
| ART=Mechanodd/build/MechanOdd_artefacts/Release | |
| for b in "$ART/VST3/MechanOdd.vst3" "$ART/AU/MechanOdd.component" "$ART/Standalone/MechanOdd.app"; do | |
| codesign --force --deep --sign - --timestamp=none "$b" | |
| codesign --verify --verbose "$b" | |
| done | |
| - name: Build pkg installer | |
| run: | | |
| set -euo pipefail | |
| VERSION="${{ github.ref_name }}" | |
| VERSION="${VERSION#v}" | |
| # Manual (workflow_dispatch) runs have no tag; keep this in step with | |
| # project(MechanOdd VERSION ...) in CMakeLists.txt. | |
| [[ "$VERSION" =~ ^[0-9] ]] || VERSION="0.1.0" | |
| ART=Mechanodd/build/MechanOdd_artefacts/Release | |
| mkdir -p pkg_root/Library/Audio/Plug-Ins/VST3 | |
| mkdir -p pkg_root/Library/Audio/Plug-Ins/Components | |
| cp -r "$ART/VST3/MechanOdd.vst3" pkg_root/Library/Audio/Plug-Ins/VST3/ | |
| cp -r "$ART/AU/MechanOdd.component" pkg_root/Library/Audio/Plug-Ins/Components/ | |
| pkgbuild \ | |
| --root pkg_root \ | |
| --identifier com.FXMechanics.MechanOdd \ | |
| --version "$VERSION" \ | |
| --install-location / \ | |
| MechanOdd-macOS.pkg | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-pkg | |
| path: MechanOdd-macOS.pkg | |
| - name: Package VST3, AU and Standalone zips | |
| run: | | |
| ART=Mechanodd/build/MechanOdd_artefacts/Release | |
| mkdir -p staging | |
| cp -r "$ART/VST3/MechanOdd.vst3" staging/ | |
| cp -r "$ART/AU/MechanOdd.component" staging/ | |
| cp -r "$ART/Standalone/MechanOdd.app" staging/ | |
| zip -r ${{ github.workspace }}/MechanOdd-macOS-universal.zip staging/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-zip | |
| path: MechanOdd-macOS-universal.zip | |
| # ── Publish GitHub Release ──────────────────────────────────────────────── | |
| release: | |
| needs: [build-linux-x86_64, build-windows, build-macos] | |
| # Manual runs build and verify but must not publish. | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artefacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| artifacts/*.zip | |
| artifacts/*.pkg | |
| generate_release_notes: true |