name: build on: [push, pull_request] env: CACHE_VERSION: 2 CARDINAL_UNDER_WINE: 1 CIBUILD: true EMSCRIPTEN_VERSION: 3.1.27 DEBIAN_FRONTEND: noninteractive HOMEBREW_NO_AUTO_UPDATE: 1 LIBGL_ALWAYS_SOFTWARE: true PAWPAW_SKIP_LTO: 1 jobs: linux: strategy: matrix: target: [aarch64, armhf, i386, riscv64, x86_64] runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up build cache id: cache uses: actions/cache@v3 with: path: | ~/PawPawBuilds src/Rack/dep/bin src/Rack/dep/include src/Rack/dep/lib src/Rack/dep/share src/Rack/dep/jansson-2.12 src/Rack/dep/libarchive-3.4.3 src/Rack/dep/libsamplerate-0.1.9 src/Rack/dep/speexdsp-SpeexDSP-1.2rc3 src/Rack/dep/zstd-1.4.5 key: linux-${{ matrix.target }}-v${{ env.CACHE_VERSION }} - name: Fix GitHub's mess run: | sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list sudo apt-get update -qq sudo apt-get install -yqq --allow-downgrades libgd3/focal libpcre2-8-0/focal libpcre2-16-0/focal libpcre2-32-0/focal libpcre2-posix2/focal sudo apt-get purge -yqq libclang* libgbm* libllvm* libmono* moby* mono* php* libgdiplus libpcre2-posix3 libzip4 sudo apt-get clean - name: Setup dependencies (aarch64) if: ${{ matrix.target == 'aarch64' }} shell: bash run: | sudo dpkg --add-architecture arm64 sudo sed -i "s/deb http/deb [arch=amd64] http/" /etc/apt/sources.list echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports-arm64.list echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-arm64.list echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-arm64.list sudo apt-get update -qq sudo apt-get install -yqq g++-aarch64-linux-gnu libasound2-dev:arm64 libdbus-1-dev:arm64 libgl1-mesa-dev:arm64 libglib2.0-dev:arm64 libsdl2-dev:arm64 libx11-dev:arm64 libxcursor-dev:arm64 libxext-dev:arm64 libxrandr-dev:arm64 gperf qemu-user-static sudo apt-get clean - name: Setup dependencies (armhf) if: ${{ matrix.target == 'armhf' }} shell: bash run: | sudo dpkg --add-architecture armhf sudo sed -i "s/deb http/deb [arch=amd64] http/" /etc/apt/sources.list echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports-armhf.list echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-armhf.list echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-armhf.list sudo apt-get update -qq sudo apt-get install -yqq g++-arm-linux-gnueabihf libasound2-dev:armhf libdbus-1-dev:armhf libgl1-mesa-dev:armhf libglib2.0-dev:armhf libsdl2-dev:armhf libx11-dev:armhf libxcursor-dev:armhf libxext-dev:armhf libxrandr-dev:armhf gperf qemu-user-static sudo apt-get clean - name: Setup dependencies (i386) if: ${{ matrix.target == 'i386' }} shell: bash run: | sudo dpkg --add-architecture i386 sudo apt-get update -qq sudo apt-get install -yqq g++-i686-linux-gnu libasound2-dev:i386 libdbus-1-dev:i386 libgl1-mesa-dev:i386 libglib2.0-dev:i386 libsdl2-dev:i386 libx11-dev:i386 libxcursor-dev:i386 libxext-dev:i386 libxrandr-dev:i386 gperf sudo apt-get clean - name: Setup dependencies (riscv64) if: ${{ matrix.target == 'riscv64' }} shell: bash run: | sudo dpkg --add-architecture riscv64 sudo sed -i "s/deb http/deb [arch=amd64] http/" /etc/apt/sources.list echo "deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports focal main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports-riscv64.list echo "deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-riscv64.list echo "deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-riscv64.list sudo apt-get update -qq sudo apt-get install -yqq g++-riscv64-linux-gnu libasound2-dev:riscv64 libdbus-1-dev:riscv64 libgl1-mesa-dev:riscv64 libglapi-mesa:riscv64 libglvnd0:riscv64 libglib2.0-dev:riscv64 libsdl2-dev:riscv64 libx11-dev:riscv64 libxcursor-dev:riscv64 libxext-dev:riscv64 libxrandr-dev:riscv64 gperf qemu-user-static sudo apt-get clean - name: Setup dependencies (x86_64) if: ${{ matrix.target == 'x86_64' }} shell: bash run: | sudo apt-get update -qq sudo apt-get install -yqq libasound2-dev libdbus-1-dev libgl1-mesa-dev libglib2.0-dev libsdl2-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev gperf sudo apt-get clean - name: Set up ccache uses: hendrikmuhs/ccache-action@v1.2 with: key: ccache-linux-${{ matrix.target }}-v${{ env.CACHE_VERSION }} - name: Build extra dependencies env: PKG_CONFIG_PATH: /usr/lib/${{ matrix.target }}-linux-gnu/pkgconfig run: | ./deps/PawPaw/bootstrap-cardinal.sh linux-${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh linux-${{ matrix.target }} - name: Build linux arm64 cross-compiled run: | pushd deps/PawPaw; source local.env linux-${{ matrix.target }}; popd export PATH="/usr/lib/ccache:${PATH}" export PKG_CONFIG_PATH+=:/usr/lib/${{ matrix.target }}-linux-gnu/pkgconfig make features make HAVE_PULSEAUDIO=false NOOPT=true -j $(nproc) make unzipfx - name: Set sha8 (non-release) if: startsWith(github.ref, 'refs/tags/') != true run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV - name: Set sha8 (release) if: startsWith(github.ref, 'refs/tags/') run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV - name: Pack binaries run: | tar -c -h --hard-dereference -z -f ${{ github.event.repository.name }}-linux-arm64-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep -e lv2 -e vst -e clap) ../CardinalJACK ../CardinalNative ../LICENSE ../README.md ../docs - uses: actions/upload-artifact@v3 with: name: ${{ github.event.repository.name }}-linux-arm64-${{ github.event.pull_request.number || env.SHA8 }} path: | *.tar.gz - uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: tag_name: ${{ github.ref_name }} name: ${{ github.ref_name }} draft: false prerelease: false files: | *.tar.gz linux-x86_64-debug: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up dependencies run: | sudo apt-get update -qq sudo apt-get install -yqq libasound2-dev libdbus-1-dev libgl1-mesa-dev liblo-dev libsdl2-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev gperf sudo apt-get clean - name: Build linux x86_64 (debug) env: LDFLAGS: -static-libgcc -static-libstdc++ run: | make features # multiple jobs for building carla, deps and plugins make DEBUG=true carla deps dgl plugins resources -j $(nproc) # single job for final build stage, otherwise we might get killed due to OOM make DEBUG=true HAVE_PULSEAUDIO=false -j 1 - name: Set sha8 id: slug run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV - name: Pack binaries run: | tar -c -h --hard-dereference -z -f ${{ github.event.repository.name }}-linux-x86_64-debug-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep -e lv2 -e vst -e clap) ../LICENSE ../README.md ../docs - uses: actions/upload-artifact@v3 with: name: ${{ github.event.repository.name }}-linux-x86_64-debug-${{ github.event.pull_request.number || env.SHA8 }} path: | *.tar.gz linux-headless: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up dependencies run: | sudo apt-get update -qq sudo apt-get remove -yqq libcairo2-dev libx11-dev libx11-dev libxext-dev sudo apt-get install -yqq liblo-dev sudo apt-get clean - name: Build linux (headless) run: | make HEADLESS=true features make HEADLESS=true -j $(nproc) linux-lto: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up dependencies run: | sudo apt-get update -qq sudo apt-get install -yqq libasound2-dev libdbus-1-dev libgl1-mesa-dev liblo-dev libsdl2-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev gperf sudo apt-get clean - name: Build linux (LTO) run: | make SYSDEPS=true features make SYSDEPS=true WITH_LTO=true -j $(nproc) linux-sysdeps: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up dependencies run: | sudo apt-get update -qq sudo apt-get install -yqq libdbus-1-dev libgl1-mesa-dev liblo-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev libarchive-dev libfftw3-dev libjansson-dev libsamplerate0-dev libsndfile1-dev libspeexdsp-dev sudo apt-get clean - name: Build linux (sysdeps) run: | make features make SYSDEPS=true -j $(nproc) macos: strategy: matrix: target: [intel, universal] runs-on: macos-11 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up cache id: cache uses: actions/cache@v3 with: path: | ~/PawPawBuilds src/Rack/dep/bin src/Rack/dep/include src/Rack/dep/lib src/Rack/dep/share src/Rack/dep/jansson-2.12 src/Rack/dep/libarchive-3.4.3 src/Rack/dep/libsamplerate-0.1.9 src/Rack/dep/speexdsp-SpeexDSP-1.2rc3 src/Rack/dep/zstd-1.4.5 key: macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }} - name: Build extra dependencies run: | export PATH="/usr/local/opt/ccache/libexec:${PATH}" ./deps/PawPaw/bootstrap-cardinal.sh macos-${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh macos-${{ matrix.target }} - name: Set up ccache if: steps.cache.outputs.cache-hit == 'true' uses: hendrikmuhs/ccache-action@v1.2 with: key: ccache-macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }} - name: Build macOS (base) if: steps.cache.outputs.cache-hit == 'true' run: | export PATH="/usr/local/opt/ccache/libexec:${PATH}" pushd deps/PawPaw; source local.env macos-${{ matrix.target }}; popd make features make NOOPT=true -j $(sysctl -n hw.logicalcpu) - name: Build macOS (AU using juce) if: steps.cache.outputs.cache-hit == 'true' run: | export PATH="/usr/local/opt/ccache/libexec:${PATH}" pushd deps/PawPaw; source local.env macos-${{ matrix.target }}; popd git clone --depth=1 -b 6.1.6 https://github.com/DISTRHO/JUCE.git jucewrapper/JUCE # sed -i -e 's/kAudioUnitProperty_SupportsMPE/kAudioUnitProperty_ignore_SupportsMPE/' jucewrapper/JUCE/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h mkdir -p jucewrapper/build pushd jucewrapper/build; cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd mv jucewrapper/build/*_artefacts/Release/AU/*.component bin/ - name: Build macOS (intel packaging) if: ${{ steps.cache.outputs.cache-hit == 'true' && matrix.target == 'intel' }} env: MACOS_ARCHS: 'x86_64' run: | pushd deps/PawPaw; source local.env macos-${{ matrix.target }}; popd ./utils/create-macos-installer.sh - name: Build macOS (universal packaging) if: ${{ steps.cache.outputs.cache-hit == 'true' && matrix.target == 'universal' }} env: MACOS_ARCHS: 'arm64,x86_64' run: | pushd deps/PawPaw; source local.env macos-${{ matrix.target }}; popd ./utils/create-macos-installer.sh - name: Set sha8 (non-release) if: startsWith(github.ref, 'refs/tags/') != true run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV - name: Set sha8 (release) if: startsWith(github.ref, 'refs/tags/') run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV - name: Rename macOS bundle if: steps.cache.outputs.cache-hit == 'true' run: | mv ${{ github.event.repository.name }}-macOS.pkg ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.pkg - uses: actions/upload-artifact@v3 with: name: ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }} path: | ${{ github.event.repository.name }}-*.pkg - uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: tag_name: ${{ github.ref_name }} name: ${{ github.ref_name }} draft: false prerelease: false files: | ${{ github.event.repository.name }}-*.pkg modduo: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up cache uses: actions/cache@v3 id: mpb-cache with: path: | ~/mod-workdir key: modduo-static-v${{ env.CACHE_VERSION }} - name: Set up dependencies run: | sudo apt-get update -qq sudo apt-get install -yqq acl bc curl cvs git mercurial rsync subversion wget bison bzip2 flex gawk gperf gzip help2man nano perl patch tar texinfo unzip automake binutils build-essential cpio libtool libncurses-dev pkg-config python libtool-bin liblo-dev qemu-user-static sudo apt-get install -yqq pandoc texlive-latex-recommended texlive-latex-extra sudo apt-get clean - name: Bootstrap toolchain if: steps.mpb-cache.outputs.cache-hit != 'true' run: | git clone --depth=1 https://github.com/moddevices/mod-plugin-builder.git deps/mod-plugin-builder sed -i "s/CT_LOG_PROGRESS_BAR=y/CT_LOG_PROGRESS_BAR=n/" deps/mod-plugin-builder/toolchain/*.config $(pwd)/deps/mod-plugin-builder/bootstrap.sh modduo-static minimal && $(pwd)/deps/mod-plugin-builder/.clean-install.sh modduo-static - name: Build for modduo if: steps.mpb-cache.outputs.cache-hit == 'true' run: | make HEADLESS=true modduo-features make HEADLESS=true MODDUO=true modduo -j $(nproc) - name: Set sha8 id: slug run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV - name: Pack binaries if: steps.mpb-cache.outputs.cache-hit == 'true' run: | tar -c -h --hard-dereference -z -f ${{ github.event.repository.name }}-modduo-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep lv2) - uses: actions/upload-artifact@v3 with: name: ${{ github.event.repository.name }}-modduo-${{ github.event.pull_request.number || env.SHA8 }} path: | *.tar.gz modduox: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up cache uses: actions/cache@v3 id: mpb-cache with: path: | ~/mod-workdir key: modduox-v${{ env.CACHE_VERSION }} - name: Set up dependencies run: | sudo apt-get update -qq sudo apt-get install -yqq acl bc curl cvs git mercurial rsync subversion wget bison bzip2 flex gawk gperf gzip help2man nano perl patch tar texinfo unzip automake binutils build-essential cpio libtool libncurses-dev pkg-config python libtool-bin liblo-dev qemu-user-static sudo apt-get install -yqq pandoc texlive-latex-recommended texlive-latex-extra sudo apt-get clean - name: Bootstrap toolchain if: steps.mpb-cache.outputs.cache-hit != 'true' run: | git clone --depth=1 https://github.com/moddevices/mod-plugin-builder.git deps/mod-plugin-builder sed -i "s/CT_LOG_PROGRESS_BAR=y/CT_LOG_PROGRESS_BAR=n/" deps/mod-plugin-builder/toolchain/*.config $(pwd)/deps/mod-plugin-builder/bootstrap.sh modduox-static minimal && $(pwd)/deps/mod-plugin-builder/.clean-install.sh modduox-static - name: Build for modduox if: steps.mpb-cache.outputs.cache-hit == 'true' run: | make HEADLESS=true modduox-features make HEADLESS=true modduox -j $(nproc) - name: Set sha8 id: slug run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV - name: Pack binaries if: steps.mpb-cache.outputs.cache-hit == 'true' run: | tar -c -h --hard-dereference -z -f ${{ github.event.repository.name }}-modduox-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep lv2) - uses: actions/upload-artifact@v3 with: name: ${{ github.event.repository.name }}-modduox-${{ github.event.pull_request.number || env.SHA8 }} path: | *.tar.gz moddwarf: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up cache uses: actions/cache@v3 id: mpb-cache with: path: | ~/mod-workdir key: moddwarf-v${{ env.CACHE_VERSION }} - name: Set up dependencies run: | sudo apt-get update -qq sudo apt-get install -yqq acl bc curl cvs git mercurial rsync subversion wget bison bzip2 flex gawk gperf gzip help2man nano perl patch tar texinfo unzip automake binutils build-essential cpio libtool libncurses-dev pkg-config python libtool-bin liblo-dev qemu-user-static sudo apt-get install -yqq pandoc texlive-latex-recommended texlive-latex-extra sudo apt-get clean - name: Bootstrap toolchain if: steps.mpb-cache.outputs.cache-hit != 'true' run: | git clone --depth=1 https://github.com/moddevices/mod-plugin-builder.git deps/mod-plugin-builder sed -i "s/CT_LOG_PROGRESS_BAR=y/CT_LOG_PROGRESS_BAR=n/" deps/mod-plugin-builder/toolchain/*.config $(pwd)/deps/mod-plugin-builder/bootstrap.sh moddwarf minimal && $(pwd)/deps/mod-plugin-builder/.clean-install.sh moddwarf - name: Build for moddwarf if: steps.mpb-cache.outputs.cache-hit == 'true' run: | make HEADLESS=true moddwarf-features make HEADLESS=true moddwarf -j $(nproc) - name: Set sha8 id: slug run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV - name: Pack binaries if: steps.mpb-cache.outputs.cache-hit == 'true' run: | tar -c -h --hard-dereference -z -f ${{ github.event.repository.name }}-moddwarf-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep lv2) - uses: actions/upload-artifact@v3 with: name: ${{ github.event.repository.name }}-moddwarf-${{ github.event.pull_request.number || env.SHA8 }} path: | *.tar.gz wasm: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up cache id: cache uses: actions/cache@v3 with: path: | ~/PawPawBuilds src/Rack/dep/bin src/Rack/dep/include src/Rack/dep/lib src/Rack/dep/share src/Rack/dep/jansson-2.12 src/Rack/dep/libarchive-3.4.3 src/Rack/dep/libsamplerate-0.1.9 src/Rack/dep/speexdsp-SpeexDSP-1.2rc3 src/Rack/dep/zstd-1.4.5 key: wasm-v${{ env.CACHE_VERSION }} - name: Set up dependencies run: | sudo apt-get update -qq sudo apt-get install -yqq brotli gperf sudo apt-get clean [ -e ~/PawPawBuilds/emsdk ] || git clone https://github.com/emscripten-core/emsdk.git ~/PawPawBuilds/emsdk cd ~/PawPawBuilds/emsdk && ./emsdk install ${{ env.EMSCRIPTEN_VERSION }} && ./emsdk activate ${{ env.EMSCRIPTEN_VERSION }} - name: Build extra dependencies run: | source ~/PawPawBuilds/emsdk/emsdk_env.sh ./deps/PawPaw/bootstrap-cardinal.sh wasm && ./deps/PawPaw/.cleanup.sh wasm - name: Build wasm cross-compiled if: steps.cache.outputs.cache-hit == 'true' run: | source ~/PawPawBuilds/emsdk/emsdk_env.sh pushd deps/PawPaw; source local.env wasm; popd make features make HAVE_LIBLO=false NOOPT=true -j $(nproc) - name: Make wasm versioned and compress if: steps.cache.outputs.cache-hit == 'true' run: | VERSION=$(cat Makefile | awk 'sub("VERSION = ","")') cd bin sed -i "s/CardinalMini\./CardinalMini-v${VERSION}\./g" *.html *.js sed -i "s/CardinalNative\./CardinalNative-v${VERSION}\./g" *.html *.js mv CardinalMini.data CardinalMini-v${VERSION}.data mv CardinalMini.js CardinalMini-v${VERSION}.js mv CardinalMini.wasm CardinalMini-v${VERSION}.wasm mv CardinalNative.data CardinalNative-v${VERSION}.data mv CardinalNative.js CardinalNative-v${VERSION}.js mv CardinalNative.wasm CardinalNative-v${VERSION}.wasm brotli -k -q 11 *.data *.html *.js *.wasm - name: Set sha8 (non-release) if: startsWith(github.ref, 'refs/tags/') != true run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV - name: Set sha8 (release) if: startsWith(github.ref, 'refs/tags/') run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV - name: Pack binaries if: steps.cache.outputs.cache-hit == 'true' run: | cd bin; zip -r -9 ../${{ github.event.repository.name }}-wasm-${{ github.event.pull_request.number || env.SHA8 }}.zip $(ls *.br *.html *.data *.js *.wasm) - uses: actions/upload-artifact@v3 with: name: ${{ github.event.repository.name }}-wasm-${{ github.event.pull_request.number || env.SHA8 }} path: | *.zip - uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: tag_name: ${{ github.ref_name }} name: ${{ github.ref_name }} draft: false prerelease: false files: | *.zip wasm-noopt: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up cache id: cache uses: actions/cache@v3 with: path: | ~/PawPawBuilds src/Rack/dep/bin src/Rack/dep/include src/Rack/dep/lib src/Rack/dep/share src/Rack/dep/jansson-2.12 src/Rack/dep/libarchive-3.4.3 src/Rack/dep/libsamplerate-0.1.9 src/Rack/dep/speexdsp-SpeexDSP-1.2rc3 src/Rack/dep/zstd-1.4.5 key: wasm-noopt-v${{ env.CACHE_VERSION }} - name: Set up dependencies run: | sudo apt-get update -qq sudo apt-get install -yqq brotli gperf sudo apt-get clean [ -e ~/PawPawBuilds/emsdk ] || git clone https://github.com/emscripten-core/emsdk.git ~/PawPawBuilds/emsdk cd ~/PawPawBuilds/emsdk && ./emsdk install ${{ env.EMSCRIPTEN_VERSION }} && ./emsdk activate ${{ env.EMSCRIPTEN_VERSION }} - name: Build extra dependencies env: PAWPAW_NOSIMD: 1 run: | source ~/PawPawBuilds/emsdk/emsdk_env.sh ./deps/PawPaw/bootstrap-cardinal.sh wasm && ./deps/PawPaw/.cleanup.sh wasm - name: Build wasm-noopt cross-compiled if: steps.cache.outputs.cache-hit == 'true' env: PAWPAW_NOSIMD: 1 NOSIMD: true run: | source ~/PawPawBuilds/emsdk/emsdk_env.sh pushd deps/PawPaw; source local.env wasm; popd # FIXME send patch upstream, assuming this works.. sed -i -e 's/defined(__riscv)/defined(__riscv) || defined(__EMSCRIPTEN__)/' plugins/surgext/surge/src/common/globals.h make features make HAVE_LIBLO=false NOOPT=true -j $(nproc) make HAVE_LIBLO=false NOOPT=true -j $(nproc) -C src/CardinalMiniSep modgui - name: Make wasm-noopt versioned and compress if: steps.cache.outputs.cache-hit == 'true' run: | VERSION=$(cat Makefile | awk 'sub("VERSION = ","")') cd bin sed -i "s/CardinalMini\./CardinalMini-noopt-v${VERSION}\./g" *.html *.js sed -i "s/CardinalNative\./CardinalNative-noopt-v${VERSION}\./g" *.html *.js mv CardinalMini.data CardinalMini-noopt-v${VERSION}.data mv CardinalMini.js CardinalMini-noopt-v${VERSION}.js mv CardinalMini.wasm CardinalMini-noopt-v${VERSION}.wasm mv CardinalNative.data CardinalNative-noopt-v${VERSION}.data mv CardinalNative.js CardinalNative-noopt-v${VERSION}.js mv CardinalNative.wasm CardinalNative-noopt-v${VERSION}.wasm brotli -k -q 11 *.data *.html *.js *.wasm - name: Set sha8 (non-release) if: startsWith(github.ref, 'refs/tags/') != true run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV - name: Set sha8 (release) if: startsWith(github.ref, 'refs/tags/') run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV - name: Pack binaries if: steps.cache.outputs.cache-hit == 'true' run: | cd bin; zip -r -9 ../${{ github.event.repository.name }}-wasm-noopt-${{ github.event.pull_request.number || env.SHA8 }}.zip $(ls *.br *.html *.data *.js *.wasm-noopt) CardinalMini.lv2/modgui - uses: actions/upload-artifact@v3 with: name: ${{ github.event.repository.name }}-wasm-noopt-${{ github.event.pull_request.number || env.SHA8 }} path: | *.zip - uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: tag_name: ${{ github.ref_name }} name: ${{ github.ref_name }} draft: false prerelease: false files: | *.zip windows: strategy: matrix: target: [win32, win64] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up cache id: cache uses: actions/cache@v3 with: path: | ~/PawPawBuilds src/Rack/dep/bin src/Rack/dep/include src/Rack/dep/lib src/Rack/dep/share src/Rack/dep/jansson-2.12 src/Rack/dep/libarchive-3.4.3 src/Rack/dep/libsamplerate-0.1.9 src/Rack/dep/speexdsp-SpeexDSP-1.2rc3 src/Rack/dep/zstd-1.4.5 key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }} - name: Fix GitHub's mess run: | sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list sudo apt-get update -qq sudo apt-get install -yqq --allow-downgrades libgd3/jammy sudo apt-get purge -yqq libclang* libgbm* libllvm* libmono* moby* mono* msbuild* php* libgdiplus libpcre2-posix3 libzip4 sudo apt-get clean - name: Set up dependencies if: ${{ matrix.target == 'win32' }} run: | sudo dpkg --add-architecture i386 sudo apt-get update -qq sudo apt-get install -yqq binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 wine-stable:i386 gperf qttools5-dev qttools5-dev-tools xvfb sudo apt-get clean - name: Set up dependencies if: ${{ matrix.target == 'win64' }} run: | sudo dpkg --add-architecture i386 sudo apt-get update -qq sudo apt-get install -yqq binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable gperf qttools5-dev qttools5-dev-tools xvfb sudo apt-get clean - name: Set up ccache uses: hendrikmuhs/ccache-action@v1.2 with: key: ccache-${{ matrix.target }}-v${{ env.CACHE_VERSION }} - name: Build extra dependencies run: | ./deps/PawPaw/bootstrap-cardinal.sh ${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh ${{ matrix.target }} - name: Build cross-compiled (base) if: steps.cache.outputs.cache-hit == 'true' run: | export PATH="/usr/lib/ccache:${PATH}" pushd deps/PawPaw; source local.env ${{ matrix.target }}; popd make features make NOOPT=true -j $(nproc) - name: Build cross-compiled (carla) if: steps.cache.outputs.cache-hit == 'true' run: | export PATH="/usr/lib/ccache:${PATH}" pushd deps/PawPaw; source local.env ${{ matrix.target }}; popd make carla-win32 -j $(nproc) make -C carla EMBED_TARGET=true TESTING=true dist make -C carla EMBED_TARGET=true TESTING=true dist - name: Build cross-compiled (packaging) if: steps.cache.outputs.cache-hit == 'true' run: | pushd deps/PawPaw; source local.env ${{ matrix.target }}; popd xvfb-run ./utils/create-windows-installer.sh ${{ matrix.target }} make unzipfx - name: Set sha8 (non-release) if: startsWith(github.ref, 'refs/tags/') != true run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV - name: Set sha8 (release) if: startsWith(github.ref, 'refs/tags/') run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV - name: Pack binaries if: steps.cache.outputs.cache-hit == 'true' run: | pushd bin zip -r -9 ../${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.zip $(ls | grep -e lv2 -e vst -e clap) popd zip -u -9 ${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.zip LICENSE README.md docs/*.* CardinalJACK.exe CardinalNative.exe - uses: actions/upload-artifact@v3 with: name: ${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }} path: | Cardinal-*.exe Cardinal-*.zip - uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: tag_name: ${{ github.ref_name }} name: ${{ github.ref_name }} draft: false prerelease: false files: | Cardinal-*.exe Cardinal-*.zip source-tarball: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up dependencies run: | sudo apt-get update -qq sudo apt-get install -yqq liblo-dev sudo apt-get clean - name: Create source tarball run: | make HEADLESS=true tarball make HEADLESS=true tarball+deps - name: Set sha8 (non-release) if: startsWith(github.ref, 'refs/tags/') != true run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV - name: Set sha8 (release) if: startsWith(github.ref, 'refs/tags/') run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV - uses: actions/upload-artifact@v3 with: name: ${{ github.event.repository.name }}-source-${{ github.event.pull_request.number || env.SHA8 }} path: | /home/runner/cardinal*.tar.xz /home/runner/*/cardinal*.tar.xz /home/runner/*/*/cardinal*.tar.xz - uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: tag_name: ${{ github.ref_name }} name: ${{ github.ref_name }} draft: false prerelease: false files: | /home/runner/cardinal*.tar.xz /home/runner/*/cardinal*.tar.xz /home/runner/*/*/cardinal*.tar.xz plugin-validation: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up cache id: cache uses: actions/cache@v3 with: path: | src/Rack/dep/bin src/Rack/dep/include src/Rack/dep/lib src/Rack/dep/share src/Rack/dep/jansson-2.12 src/Rack/dep/libarchive-3.4.3 src/Rack/dep/libsamplerate-0.1.9 src/Rack/dep/speexdsp-SpeexDSP-1.2rc3 src/Rack/dep/zstd-1.4.5 key: pluginval-v${{ env.CACHE_VERSION }} - name: Set up dependencies run: | # custom repos wget https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos_11.1.0_all.deb sudo dpkg -i kxstudio-repos_11.1.0_all.deb sudo apt-get update -qq # build-deps sudo apt-get install -yqq libdbus-1-dev libgl1-mesa-dev liblo-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev # runtime testing sudo apt-get install -yqq carla-git lilv-utils lv2-dev lv2lint kxstudio-lv2-extensions mod-lv2-extensions valgrind xvfb sudo apt-get clean # multiple jobs for building carla, deps and plugins - name: Build Cardinal (carla, deps and plugins) env: CFLAGS: -g CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions LDFLAGS: -static-libgcc -static-libstdc++ run: | make features make NOOPT=true SKIP_STRIPPING=true carla deps dgl plugins resources -j $(nproc) # single job for final build stage, otherwise we might get killed due to OOM - name: Build Cardinal (final build stage) env: CFLAGS: -g CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions LDFLAGS: -static-libgcc -static-libstdc++ run: | make features make NOOPT=true SKIP_STRIPPING=true -j 1 -C src jack make NOOPT=true -j 1 ./dpf/utils/generate-ttl.sh - name: Run Cardinal self-tests run: | # --exit-on-first-error=yes xvfb-run valgrind \ --gen-suppressions=all \ --error-exitcode=255 \ --leak-check=no \ --track-origins=yes \ --keep-debuginfo=yes \ --suppressions=./dpf/utils/valgrind-dpf.supp \ ./bin/Cardinal selftest - name: Validate LV2 ttl syntax run: | lv2_validate \ /usr/lib/lv2/kx-meta/*.ttl \ /usr/lib/lv2/kx-control-input-port-change-request.lv2/*.ttl \ /usr/lib/lv2/kx-programs.lv2/*.ttl \ /usr/lib/lv2/mod.lv2/*.ttl \ /usr/lib/lv2/modgui.lv2/*.ttl \ ./bin/*.lv2/*.ttl - name: Validate LV2 metadata and binaries run: | export LV2_PATH=/tmp/lv2-path mkdir ${LV2_PATH} mv bin/CardinalFX.lv2 bin/CardinalSynth.lv2 ${LV2_PATH} cp -r /usr/lib/lv2/{atom,buf-size,core,data-access,kx-control-input-port-change-request,kx-programs,instance-access,midi,mod,modgui,parameters,port-groups,port-props,options,patch,presets,resize-port,state,time,ui,units,urid,worker}.lv2 ${LV2_PATH} xvfb-run lv2lint -s lv2_generate_ttl -l ld-linux-x86-64.so.2 -M nopack $(lv2ls) - name: Test LV2 plugin run: | export LV2_PATH=/tmp/lv2-path for p in $(lv2ls); do \ env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \ xvfb-run valgrind \ --error-exitcode=255 \ --leak-check=no \ --track-origins=yes \ --keep-debuginfo=yes \ --suppressions=./dpf/utils/valgrind-dpf.supp \ /usr/lib/carla/carla-bridge-native lv2 "" ${p}; \ done - name: Test VST2 plugin run: | for p in $(ls bin/*.vst/*.so); do \ env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \ xvfb-run valgrind \ --error-exitcode=255 \ --leak-check=no \ --track-origins=yes \ --keep-debuginfo=yes \ --suppressions=./dpf/utils/valgrind-dpf.supp \ /usr/lib/carla/carla-bridge-native vst2 ./${p} ""; \ done - name: Test VST3 plugin run: | for p in $(ls bin/ | grep vst3); do \ env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \ xvfb-run valgrind \ --error-exitcode=255 \ --leak-check=no \ --track-origins=yes \ --keep-debuginfo=yes \ --suppressions=./dpf/utils/valgrind-dpf.supp \ /usr/lib/carla/carla-bridge-native vst3 ./bin/${p} ""; \ done