fix(ci): add cross-compilation for Intel Mac builds #4
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 VCV Rack Plugin | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| env: | |
| rack-sdk-version: 2.6.1 | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build: | |
| name: ${{ matrix.platform }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: win-x64 | |
| os: windows-latest | |
| arch-flags: "" | |
| install-dependencies: | | |
| choco install zip | |
| - platform: mac-x64 | |
| os: macos-15 | |
| arch-flags: -arch x86_64 | |
| install-dependencies: | | |
| brew install zstd | |
| - platform: mac-arm64 | |
| os: macos-latest | |
| arch-flags: "" | |
| install-dependencies: | | |
| brew install zstd | |
| - platform: lin-x64 | |
| os: ubuntu-latest | |
| arch-flags: "" | |
| install-dependencies: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgl1-mesa-dev zstd | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies | |
| run: ${{ matrix.install-dependencies }} | |
| - name: Download Rack SDK | |
| run: | | |
| curl -L https://vcvrack.com/downloads/Rack-SDK-${{ env.rack-sdk-version }}-${{ matrix.platform }}.zip -o rack-sdk.zip | |
| unzip -q rack-sdk.zip | |
| - name: Build plugin | |
| run: | | |
| export RACK_DIR=$PWD/Rack-SDK | |
| export CXXFLAGS="${{ matrix.arch-flags }}" | |
| export LDFLAGS="${{ matrix.arch-flags }}" | |
| make -j$(nproc 2>/dev/null || sysctl -n hw.logicalcpu) | |
| - name: Create distribution | |
| run: | | |
| export RACK_DIR=$PWD/Rack-SDK | |
| export CXXFLAGS="${{ matrix.arch-flags }}" | |
| export LDFLAGS="${{ matrix.arch-flags }}" | |
| export ARCH=${{ matrix.platform }} | |
| make dist | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: plugin-${{ matrix.platform }} | |
| path: dist/*.vcvplugin | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| pattern: plugin-* | |
| merge-multiple: true | |
| - name: List artifacts | |
| run: ls -la artifacts/ | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: artifacts/*.vcvplugin | |
| draft: false | |
| prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |