diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..44e48225 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,335 @@ +name: build + +on: + push: + branches: + - '*' + tags: + - '[0-9]*' + - 'v[0-9]*' + pull_request: + branches: + - '*' +env: + BUILD_TYPE: Release + +jobs: + clang_tidy: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Set up dependencies + run: | + sudo apt-get update && \ + sudo apt-get install \ + clang-tidy \ + libsndfile1-dev + - name: Clang Tidy + working-directory: ${{runner.workspace}} + run: cd "$GITHUB_WORKSPACE" && scripts/run_clang_tidy.sh + + build_for_linux: + runs-on: ubuntu-18.04 + steps: + - name: Set install name + run: | + echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV" + echo "install_name=sfizz-${GITHUB_REF##*/}-linux" >> "$GITHUB_ENV" + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Set up dependencies + run: | + sudo apt-get update && \ + sudo apt-get install \ + libjack-jackd2-dev \ + libsndfile1-dev \ + libcairo2-dev \ + libfontconfig1-dev \ + libx11-xcb-dev \ + libxcb-util-dev \ + libxcb-cursor-dev \ + libxcb-xkb-dev \ + libxkbcommon-dev \ + libxkbcommon-x11-dev \ + libxcb-keysyms1-dev + - name: Create Build Environment + shell: bash + working-directory: ${{runner.workspace}} + run: cmake -E make_directory build + - name: Configure CMake + shell: bash + working-directory: ${{runner.workspace}}/build + run: | + cmake "$GITHUB_WORKSPACE" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \ + -DSFIZZ_JACK=ON \ + -DSFIZZ_VST=ON \ + -DSFIZZ_LV2_UI=ON \ + -DSFIZZ_TESTS=ON \ + -DSFIZZ_SHARED=OFF \ + -DSFIZZ_STATIC_DEPENDENCIES=OFF \ + -DSFIZZ_LV2=ON \ + -DCMAKE_CXX_STANDARD=17 + - name: Build + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config "$BUILD_TYPE" -j 2 + - name: Test + working-directory: ${{runner.workspace}}/build + shell: bash + run: tests/sfizz_tests + - name: Install + working-directory: ${{runner.workspace}}/build + shell: bash + run: | + DESTDIR="$(pwd)/$install_name" cmake --build . --config "$BUILD_TYPE" --target install + tar czvf "$install_name".tar.gz "$install_name" + - uses: actions/upload-artifact@v2 + with: + name: Linux tarball + path: ${{runner.workspace}}/build/${{env.install_name}}.tar.gz + + build_for_mod: + runs-on: ubuntu-18.04 + container: + image: jpcima/mod-plugin-builder + options: --user 0 + steps: + - name: Set install name + run: | + echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV" + echo "install_name=sfizz-${GITHUB_REF##*/}-moddevices" >> "$GITHUB_ENV" + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Fix up MOD environment + shell: bash + run: ln -sf /home/builder/mod-workdir ~/mod-workdir + - name: Create Build Environment + shell: bash + working-directory: ${{runner.workspace}} + run: mod-plugin-builder /usr/local/bin/cmake -E make_directory build + - name: Configure CMake + shell: bash + working-directory: ${{runner.workspace}}/build + run: | + mod-plugin-builder /usr/local/bin/cmake "$GITHUB_WORKSPACE" \ + -DSFIZZ_SYSTEM_PROCESSOR=armv7-a \ + -DCMAKE_BUILD_TYPE=Release -DSFIZZ_JACK=OFF -DSFIZZ_LV2_UI=OFF + - name: Build + shell: bash + working-directory: ${{runner.workspace}}/build + run: mod-plugin-builder /usr/local/bin/cmake --build . --config "$BUILD_TYPE" -- -j 2 + - name: Install + working-directory: ${{runner.workspace}}/build + shell: bash + run: | + DESTDIR="$(pwd)/$install_name" mod-plugin-builder /usr/local/bin/cmake --build . --config "$BUILD_TYPE" --target install + tar czvf "$install_name".tar.gz "$install_name" + - uses: actions/upload-artifact@v2 + with: + name: MOD devices tarball + path: ${{runner.workspace}}/build/${{env.install_name}}.tar.gz + + build_for_mingw32: + runs-on: ubuntu-18.04 + container: + image: archlinux + steps: + - name: Set install name + run: | + echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV" + echo "install_name=sfizz-${GITHUB_REF##*/}-mingw32" >> "$GITHUB_ENV" + - name: Configure pacman repositories + shell: bash + run: | + cat >>/etc/pacman.conf <//' + - name: Create Build Environment + shell: bash + working-directory: ${{runner.workspace}} + run: cmake -E make_directory build + - name: Configure CMake + shell: bash + working-directory: ${{runner.workspace}}/build + run: | + i686-w64-mingw32-cmake "$GITHUB_WORKSPACE" \ + -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \ + -DENABLE_LTO=OFF \ + -DSFIZZ_JACK=OFF \ + -DSFIZZ_VST=ON \ + -DSFIZZ_STATIC_DEPENDENCIES=ON \ + -DCMAKE_CXX_STANDARD=17 + - name: Build + shell: bash + working-directory: ${{runner.workspace}}/build + run: i686-w64-mingw32-cmake --build . --config "$BUILD_TYPE" -j 2 + - name: Install + working-directory: ${{runner.workspace}}/build + shell: bash + run: | + DESTDIR="$(pwd)/$install_name" i686-w64-mingw32-cmake --build . --config "$BUILD_TYPE" --target install + tar czvf "$install_name".tar.gz "$install_name" + - uses: actions/upload-artifact@v2 + with: + name: Win32 MinGW tarball + path: ${{runner.workspace}}/build/${{env.install_name}}.tar.gz + + build_for_mingw64: + runs-on: ubuntu-18.04 + container: + image: archlinux + steps: + - name: Set install name + run: | + echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV" + echo "install_name=sfizz-${GITHUB_REF##*/}-mingw64" >> "$GITHUB_ENV" + - name: Configure pacman repositories + shell: bash + run: | + cat >>/etc/pacman.conf <//' + - name: Create Build Environment + shell: bash + working-directory: ${{runner.workspace}} + run: cmake -E make_directory build + - name: Configure CMake + shell: bash + working-directory: ${{runner.workspace}}/build + run: | + x86_64-w64-mingw32-cmake "$GITHUB_WORKSPACE" \ + -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \ + -DENABLE_LTO=OFF \ + -DSFIZZ_JACK=OFF \ + -DSFIZZ_VST=ON \ + -DSFIZZ_STATIC_DEPENDENCIES=ON \ + -DCMAKE_CXX_STANDARD=17 + - name: Build + shell: bash + working-directory: ${{runner.workspace}}/build + run: x86_64-w64-mingw32-cmake --build . --config "$BUILD_TYPE" -j 2 + - name: Install + working-directory: ${{runner.workspace}}/build + shell: bash + run: | + DESTDIR="$(pwd)/$install_name" x86_64-w64-mingw32-cmake --build . --config "$BUILD_TYPE" --target install + tar czvf "$install_name".tar.gz "$install_name" + - uses: actions/upload-artifact@v2 + with: + name: Win64 MinGW tarball + path: ${{runner.workspace}}/build/${{env.install_name}}.tar.gz + + archive_source_code: + runs-on: ubuntu-18.04 + if: startsWith(github.ref, 'refs/tags/') + steps: + - name: Set install name + run: | + echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV" + echo "install_name=sfizz-${GITHUB_REF##*/}" >> "$GITHUB_ENV" + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Set up dependencies + run: | + sudo apt-get update && \ + sudo apt-get install \ + python-pip + sudo pip install git-archive-all + - name: Archive source code + shell: bash + run: | + cd "$GITHUB_WORKSPACE" && \ + git-archive-all --prefix="${install_name}/" -9 "${{runner.workspace}}/${install_name}.tar.gz" + - uses: actions/upload-artifact@v2 + with: + name: Source code tarball + path: ${{runner.workspace}}/${{env.install_name}}.tar.gz + + deploy: + runs-on: ubuntu-18.04 + if: startsWith(github.ref, 'refs/tags/') + needs: + - build_for_linux + - build_for_mod + - build_for_mingw32 + - build_for_mingw64 + - archive_source_code + steps: + - name: Set install name + run: | + echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV" + - uses: actions/download-artifact@v2 + with: + name: Linux tarball + - uses: actions/download-artifact@v2 + with: + name: MOD devices tarball + - uses: actions/download-artifact@v2 + with: + name: Win32 MinGW tarball + - uses: actions/download-artifact@v2 + with: + name: Win64 MinGW tarball + - uses: actions/download-artifact@v2 + with: + name: Source code tarball + - name: Display file information + shell: bash + run: ls -lR + ## Note: not using `actions/create-release@v1` + ## because it cannot update an existing release + ## see https://github.com/actions/create-release/issues/29 + - uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + tag_name: ${{env.install_ref}} + name: Release ${{env.install_ref}} + draft: false + prerelease: false + files: | + sfizz-${{env.install_ref}}-* + sfizz-${{env.install_ref}}.* diff --git a/.travis.yml b/.travis.yml index 8ed0c817..2ddb256c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,36 +8,6 @@ cache: jobs: include: - - name: "clang-tidy checks" - addons: - apt: - packages: - - clang-tidy - - wget - - unzip - - libsndfile-dev - install: .travis/download_vst_sdk.sh - script: scripts/run_clang_tidy.sh - - - name: "Linux amd64 test and build" - arch: amd64 - addons: - apt: - packages: - - libjack-jackd2-dev - - libsndfile1-dev - - libcairo2-dev - - libfontconfig1-dev - - libx11-xcb-dev - - libxcb-util-dev - - libxcb-cursor-dev - - libxcb-xkb-dev - - libxkbcommon-dev - - libxkbcommon-x11-dev - - libxcb-keysyms1-dev - install: .travis/download_cmake.sh - script: .travis/script_test_and_build.sh - - name: "Linux arm64 test and build" arch: arm64-graviton2 group: edge @@ -59,37 +29,6 @@ jobs: install: .travis/download_cmake.sh script: .travis/script_test_and_build.sh - - name: "MOD devices arm" - env: - - CONTAINER=jpcima/mod-plugin-builder - - CROSS_COMPILE=moddevices-arm - - INSTALL_DIR="sfizz-${TRAVIS_BRANCH}-moddevices" - - DEPLOY_BUILD=true - before_install: .travis/before_install_moddevices.sh - install: .travis/install_moddevices.sh - script: .travis/script_moddevices.sh - after_success: .travis/prepare_tarball.sh - - - name: "Windows mingw32" - env: - - CROSS_COMPILE=mingw32 - - CONTAINER=archlinux - - INSTALL_DIR="sfizz-${TRAVIS_BRANCH}-mingw32" - before_install: .travis/before_install_mingw.sh - install: .travis/install_mingw.sh - script: .travis/script_mingw.sh - after_success: .travis/prepare_tarball.sh - - - name: "Windows mingw64" - env: - - CROSS_COMPILE=mingw64 - - CONTAINER=archlinux - - INSTALL_DIR="sfizz-${TRAVIS_BRANCH}-mingw64" - before_install: .travis/before_install_mingw.sh - install: .travis/install_mingw.sh - script: .travis/script_mingw.sh - after_success: .travis/prepare_tarball.sh - - name: "Linux arm64 static plugins" arch: arm64-graviton2 group: edge @@ -109,43 +48,6 @@ jobs: script: .travis/script_plugins.sh after_success: .travis/prepare_tarball.sh - - name: "Linux amd64 static plugins" - env: - - INSTALL_DIR="sfizz-plugins-${TRAVIS_BRANCH}-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}" - - ENABLE_VST_PLUGIN=ON - - ENABLE_LV2_UI=ON - addons: - apt: - packages: - - libjack-jackd2-dev - - libsndfile1-dev - - libcairo2-dev - - libfontconfig1-dev - - libx11-xcb-dev - - libxcb-util-dev - - libxcb-cursor-dev - - libxcb-xkb-dev - - libxkbcommon-dev - - libxkbcommon-x11-dev - - libxcb-keysyms1-dev - install: - - .travis/download_cmake.sh - - .travis/download_static_libs.sh - script: .travis/script_plugins.sh - after_success: .travis/prepare_tarball.sh - - - stage: "Deploy" - name: "Source packaging" - if: (tag =~ /^v?[0-9]/) AND (type = push) - env: - - INSTALL_DIR="sfizz-${TRAVIS_BRANCH}-src" - addons: - apt: - packages: - - python-pip - install: sudo pip install git-archive-all - script: git-archive-all --prefix="sfizz-${TRAVIS_BRANCH}/" -9 "${INSTALL_DIR}.tar.gz" - - name: "Discord Webhook" install: skip script: bash ${TRAVIS_BUILD_DIR}/.travis/discord_webhook.sh success diff --git a/.travis/before_install_mingw.sh b/.travis/before_install_mingw.sh deleted file mode 100755 index 069f5929..00000000 --- a/.travis/before_install_mingw.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -ex -. .travis/docker_container.sh - -buildenv bash -c "echo Hello from container" # ensure to start the container -docker cp "$container":/etc/pacman.conf pacman.conf -cat >>pacman.conf < ${TRAVIS_BUILD_DIR}/docker-container-id - fi -} diff --git a/.travis/download_vst_sdk.sh b/.travis/download_vst_sdk.sh deleted file mode 100755 index 3eee309e..00000000 --- a/.travis/download_vst_sdk.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -ex - -vst_download_prefix="vst/download" -vst_sdk_archive="vst-sdk_3.6.14_build-24_2019-11-29.zip" -mkdir -p ${vst_download_prefix} -if ! [[ -f "${vst_download_prefix}/${vst_sdk_archive}" ]]; then - wget -P ${vst_download_prefix} "https://download.steinberg.net/sdk_downloads/${vst_sdk_archive}" -fi -mkdir -p vst/external -unzip -ouq "${vst_download_prefix}/${vst_sdk_archive}" -d "vst/external" diff --git a/.travis/install_mingw.sh b/.travis/install_mingw.sh deleted file mode 100755 index 882b5d52..00000000 --- a/.travis/install_mingw.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -set -ex -. .travis/docker_container.sh - -buildenv_as_root pacman -Sqyu --noconfirm -buildenv_as_root pacman -Sq --noconfirm base-devel wget mingw-w64-cmake mingw-w64-gcc mingw-w64-pkg-config mingw-w64-libsndfile -buildenv i686-w64-mingw32-gcc -v && buildenv i686-w64-mingw32-g++ -v && buildenv i686-w64-mingw32-cmake --version diff --git a/.travis/install_moddevices.sh b/.travis/install_moddevices.sh deleted file mode 100755 index e28460cb..00000000 --- a/.travis/install_moddevices.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -set -ex -. .travis/docker_container.sh diff --git a/.travis/no_container.sh b/.travis/no_container.sh deleted file mode 100755 index 528915f2..00000000 --- a/.travis/no_container.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -ex - -buildenv() { - "$@" -} diff --git a/.travis/prepare_tarball.sh b/.travis/prepare_tarball.sh index 1447feea..d19ce65d 100755 --- a/.travis/prepare_tarball.sh +++ b/.travis/prepare_tarball.sh @@ -2,14 +2,8 @@ set -ex -if ! [ -z "$CONTAINER" ]; then - . .travis/docker_container.sh -else - . .travis/no_container.sh -fi - cd build -buildenv make DESTDIR=${PWD}/${INSTALL_DIR} install +make DESTDIR=${PWD}/${INSTALL_DIR} install tar -zcvf "${INSTALL_DIR}.tar.gz" ${INSTALL_DIR} # Only release a tarball if there is a tag diff --git a/.travis/script_mingw.sh b/.travis/script_mingw.sh deleted file mode 100755 index cdd4b941..00000000 --- a/.travis/script_mingw.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -set -ex -. .travis/docker_container.sh - -# need to convert some includes to lower case (as of VST 3.7.1) -find vst/external/VST_SDK -type d -name source -exec \ - find {} -type f -name '*.[hc]' -o -name '*.[hc]pp' -print0 \; | \ - xargs -0 sed -i 's///' - -mkdir -p build/${INSTALL_DIR} && cd build -if [[ ${CROSS_COMPILE} == "mingw32" ]]; then - buildenv i686-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=Release \ - -DENABLE_LTO=OFF \ - -DSFIZZ_JACK=OFF \ - -DSFIZZ_VST=ON \ - -DSFIZZ_STATIC_DEPENDENCIES=ON \ - -DCMAKE_CXX_STANDARD=17 \ - .. - buildenv make -j2 -elif [[ ${CROSS_COMPILE} == "mingw64" ]]; then - buildenv x86_64-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=Release \ - -DENABLE_LTO=OFF \ - -DSFIZZ_JACK=OFF \ - -DSFIZZ_VST=ON \ - -DSFIZZ_STATIC_DEPENDENCIES=ON \ - -DCMAKE_CXX_STANDARD=17 \ - .. - buildenv make -j2 -fi diff --git a/.travis/script_moddevices.sh b/.travis/script_moddevices.sh deleted file mode 100755 index 3654590d..00000000 --- a/.travis/script_moddevices.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -ex -. .travis/docker_container.sh - -mkdir -p build/${INSTALL_DIR} && cd build - -buildenv mod-plugin-builder /usr/local/bin/cmake \ - -DSFIZZ_SYSTEM_PROCESSOR=armv7-a \ - -DCMAKE_BUILD_TYPE=Release -DSFIZZ_JACK=OFF -DSFIZZ_LV2_UI=OFF .. -buildenv mod-plugin-builder make -j2 diff --git a/.travis/script_osx.sh b/.travis/script_osx.sh deleted file mode 100755 index 0385f8c3..00000000 --- a/.travis/script_osx.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -ex - -mkdir -p build/${INSTALL_DIR} && cd build -cmake -DCMAKE_BUILD_TYPE=Release \ - -DSFIZZ_VST=ON \ - -DSFIZZ_AU=ON \ - -DSFIZZ_TESTS=OFF \ - -DCMAKE_CXX_STANDARD=14 \ - -DLV2PLUGIN_INSTALL_DIR=/Library/Audio/Plug-Ins/LV2 \ - -DVSTPLUGIN_INSTALL_DIR=/Library/Audio/Plug-Ins/VST3 \ - -DAUPLUGIN_INSTALL_DIR=/Library/Audio/Plug-Ins/Components \ - .. -make -j$(sysctl -n hw.ncpu) -# Xcode not currently supported, see https://gitlab.kitware.com/cmake/cmake/issues/18088 -# xcodebuild -project sfizz.xcodeproj -alltargets -configuration Debug build