clap-wrapper 0.1.0

An easy way to use clap-wrapper in your audio plugins!
Documentation
name: Validate

on: [push]
jobs:
  validate-linux:
    strategy:
      matrix:
        runner: [ubuntu-22.04]
        package: [example-nih-plug, example-clack]
        include:
          - package: example-nih-plug
            library_name: libexample_nih_plug.so
          - package: example-clack
            library_name: libexample_clack.so
          
    name: Validate "${{ matrix.package }}" (${{ matrix.runner }})
    runs-on: ${{ matrix.runner }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
            submodules: recursive

      - name: Checkout `vst3sdk`
        shell: bash
        run: |
            git clone --depth=1 https://github.com/steinbergmedia/vst3sdk
            cd vst3sdk
            git submodule update --init base
            git submodule update --init cmake
            git submodule update --init public.sdk
            git submodule update --init pluginterfaces
            cd ..

      - name: Install dependencies
        shell: bash
        run: |
            # needed for baseview and other example-nih-plug deps
            sudo apt-get install -y libgl-dev libx11-xcb-dev libxcb1-dev libxcb-dri2-0-dev libxcb-icccm4-dev libxcursor-dev libxkbcommon-dev libxcb-shape0-dev libxcb-xfixes0-dev

      - name: Build `${{ matrix.package }}`
        shell: bash
        run: |
            CLAP_WRAPPER_VST3_SDK="$(realpath vst3sdk)" CLAP_WRAPPER_VERBOSE=1 cargo build -p ${{ matrix.package }}
            
            # bundle vst3
            mkdir -p ${{ matrix.package }}.vst3/Contents/x86_64-linux/
            mv target/debug/${{ matrix.library_name }} ${{ matrix.package }}.vst3/Contents/x86_64-linux/${{ matrix.package }}.so
  
      - name: Upload VST3
        uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.package }}-${{ matrix.runner }}-vst3
          path: ${{ matrix.package }}.vst3
          retention-days: 30

      - name: Build `vst3-validator`
        shell: bash
        run: |
            cd vst3sdk
            cmake -DSMTG_ENABLE_VSTGUI_SUPPORT=OFF -DSMTG_ENABLE_VST3_PLUGIN_EXAMPLES=OFF -DSMTG_ENABLE_VST3_HOSTING_EXAMPLES=OFF -B cmake-build 
            cmake --build cmake-build --target validator
            cd ..

      - name: Run `vst3-validator`
        shell: bash
        run: |
            "./vst3sdk/cmake-build/bin/validator" -e "./${{ matrix.package }}.vst3" 

  validate-windows:
    strategy:
      matrix:
        runner: [windows-2022]
        package: [example-nih-plug, example-clack]
        include:
          - package: example-nih-plug
            library_name: example_nih_plug.dll
          - package: example-clack
            library_name: example_clack.dll

    name: Validate "${{ matrix.package }}" (${{ matrix.runner }})
    runs-on: ${{ matrix.runner }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
            submodules: recursive

      - name: Checkout `vst3sdk`
        shell: bash
        run: |
            git clone --depth=1 https://github.com/steinbergmedia/vst3sdk
            cd vst3sdk
            git submodule update --init base
            git submodule update --init cmake
            git submodule update --init public.sdk
            git submodule update --init pluginterfaces
            cd ..

      - name: Build `${{ matrix.package }}`
        shell: bash
        run: |
            CLAP_WRAPPER_VST3_SDK="$(realpath vst3sdk)" CLAP_WRAPPER_VERBOSE=1 cargo build -p ${{ matrix.package }}

            # bundle vst3. we dont really have to do that as the dll file by itself can be used as a vst3, 
            # but the validator really wants it to be a vst3 bundle so we have no choice
            # for more info on directory structure, see https://steinbergmedia.github.io/vst3_dev_portal/pages/Technical+Documentation/Locations+Format/Plugin+Format.html
            mkdir -p ${{ matrix.package }}.vst3/Contents/x86_64-win/
            mv target/debug/${{ matrix.library_name }} ${{ matrix.package }}.vst3/Contents/x86_64-win/${{ matrix.package }}.vst3

      - name: Upload VST3
        uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.package }}-${{ matrix.runner }}-vst3
          path: ${{ matrix.package }}.vst3
          retention-days: 30

      - name: Build `vst3-validator`
        shell: bash
        run: |
            cd vst3sdk
            cmake -DSMTG_ENABLE_VSTGUI_SUPPORT=OFF -DSMTG_ENABLE_VST3_PLUGIN_EXAMPLES=OFF -DSMTG_ENABLE_VST3_HOSTING_EXAMPLES=OFF -B cmake-build
            cmake --build cmake-build --target validator
            cd ..

      - name: Run `vst3-validator`
        shell: bash
        run: |
            "./vst3sdk/cmake-build/bin/Debug/validator" -e "./${{ matrix.package }}.vst3" 
      
  validate-macos:
    strategy:
      matrix:
        runner: [macos-13]
        package: [example-nih-plug, example-clack]
        include:
          - package: example-nih-plug
            library_name: libexample_nih_plug.dylib
            auv2_type: aufx
            auv2_subtype: gain
            auv2_manufacturer: Mois
          - package: example-clack
            library_name: libexample_clack.dylib
            auv2_type: aumu
            auv2_subtype: psyn
            auv2_manufacturer: Clck

    name: Validate "${{ matrix.package }}" (${{ matrix.runner }})
    runs-on: ${{ matrix.runner }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
            submodules: recursive

      - name: Checkout `vst3sdk`
        shell: bash
        run: |
            git clone --depth=1 https://github.com/steinbergmedia/vst3sdk
            cd vst3sdk
            git submodule update --init base
            git submodule update --init cmake
            git submodule update --init public.sdk
            git submodule update --init pluginterfaces
            cd ..

      - name: Checkout `AudioUnitSDK`
        shell: bash
        run: |
            git clone --depth=1 https://github.com/apple/AudioUnitSDK 

      - name: Build `${{ matrix.package }}`
        shell: bash
        run: |
            CLAP_WRAPPER_VST3_SDK="$(realpath vst3sdk)" CLAP_WRAPPER_AUV2_SDK="$(realpath AudioUnitSDK)" CLAP_WRAPPER_VERBOSE=1 cargo build -p ${{ matrix.package }}
            
            # bundle vst3 and include the Info.plist stuff
            # for more info on directory structure, see https://steinbergmedia.github.io/vst3_dev_portal/pages/Technical+Documentation/Locations+Format/Plugin+Format.html
            mkdir -p ${{ matrix.package }}.vst3/Contents/MacOS/
            cp target/debug/${{ matrix.library_name }} ${{ matrix.package }}.vst3/Contents/MacOS/${{ matrix.package }}
            cp examples/${{ matrix.package }}/Info.vst3.plist ${{ matrix.package }}.vst3/Contents/Info.plist
            echo "BNDL????" > ${{ matrix.package }}.vst3/Contents/PkgInfo

            # bundle auval and include the Info.plist stuff
            mkdir -p ${{ matrix.package }}.component/Contents/MacOS/
            cp target/debug/${{ matrix.library_name }} ${{ matrix.package }}.component/Contents/MacOS/${{ matrix.package }}
            cp examples/${{ matrix.package }}/Info.auv2.plist ${{ matrix.package }}.component/Contents/Info.plist
            echo "BNDL????" > ${{ matrix.package }}.component/Contents/PkgInfo

            # sign the plugins without an associated identity
            codesign --force --timestamp --deep -s - ${{ matrix.package }}.vst3
            codesign --force --timestamp --deep -s - ${{ matrix.package }}.component

      - name: Upload AUv2
        uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.package }}-${{ matrix.runner }}-auv2
          path: ${{ matrix.package }}.component
          retention-days: 30

      - name: Upload VST3
        uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.package }}-${{ matrix.runner }}-vst3
          path: ${{ matrix.package }}.vst3
          retention-days: 30

      - name: Build `vst3-validator`
        shell: bash
        run: |
            cd vst3sdk
            cmake -DSMTG_ENABLE_VSTGUI_SUPPORT=OFF -DSMTG_ENABLE_VST3_PLUGIN_EXAMPLES=OFF -DSMTG_ENABLE_VST3_HOSTING_EXAMPLES=OFF -B cmake-build
            cmake --build cmake-build --target validator
            cd ..

      - name: Run `vst3-validator`
        shell: bash
        run: |
            "./vst3sdk/cmake-build/bin/validator" -e "./${{ matrix.package }}.vst3" 

      - name: Run `auval`
        shell: bash
        run: |
            mkdir -p ~/Library/Audio/Plug-Ins/Components/
            cp -R ${{ matrix.package }}.component ~/Library/Audio/Plug-Ins/Components/
            killall -9 AudioComponentRegistrar || true
            auval -a
            auval -strict -v ${{ matrix.auv2_type }} ${{ matrix.auv2_subtype }} ${{ matrix.auv2_manufacturer }}