From d500c43541943b0996a2c242f58b9e07b0510059 Mon Sep 17 00:00:00 2001 From: redtide Date: Wed, 18 Sep 2019 09:13:36 +0200 Subject: [PATCH] Added Travis CI configuration. --- .travis.yml | 40 +++++++++++++++++++++++++++++++++++++++ .travis/after_success.sh | 19 +++++++++++++++++++ .travis/before_install.sh | 12 ++++++++++++ .travis/install.sh | 7 +++++++ .travis/script.sh | 16 ++++++++++++++++ README.md | 5 ++++- 6 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 .travis.yml create mode 100755 .travis/after_success.sh create mode 100755 .travis/before_install.sh create mode 100755 .travis/install.sh create mode 100755 .travis/script.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..c039afda --- /dev/null +++ b/.travis.yml @@ -0,0 +1,40 @@ +language: cpp + +matrix: + include: + - os: linux + dist: xenial + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-8 + - g++-8 + env: + - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" + + - os: osx + osx_image: xcode10.1 + +before_install: +- sh ${TRAVIS_BUILD_DIR}/.travis/before_install.sh + +install: +- sh ${TRAVIS_BUILD_DIR}/.travis/install.sh + +script: +- sh ${TRAVIS_BUILD_DIR}/.travis/script.sh + +after_success: +- sh ${TRAVIS_BUILD_DIR}/.travis/after_success.sh + +deploy: + provider: releases + skip_cleanup: true + api_key: + secure: cc6IkdalZRb+lOWzPkubCUvTcP9lBwiNBBPkXWVmeX7YXkdQlsoVQ11bZThd1Go+5Lt+jGFtEqEjJ0L7GxpdatEeBMEK5HXl0QtHAybl9J4Ax7hKba8FSX5RqPFOuKixCob6eCqJRchT26qRsQE/WYMY8DmproEFGMBHk0K4HXDWEq0HP8dbWVx3KudvellCYszUrVQYb2s49sDiF8OwSog5TiqdBqO5PRcqyt2ySmHgqwBYq7XV0pb+DxcKJcc7/gCBpBN7nyEhl8gmKELypLF81l8xUDBUjRy1jjf0r33ISHpX1MWeWIN9YzSNL0aLPQvwynAQ7OeckFAIMABah2UuYcxdd4ioXduPTbprVYpSwIyyxkeafK2jxgxwoKWi9GJZ3yAUHNS/V7Gh5DsFb7C6QDqr5gOxOMtjHwjmHnxmD44SsugjSosVzirvQR+JbrSsPsmZThQjCvwG+7hO3JatX4BXA7bp9WtgsoMrCH61gCp2GogQVLvYpgRpVErKK8PMTkt71OouewTDqD5iwc3N/2pNWP3cXxpPegerjl4R2sY0sZ57WRfW8ts7akPyqJZa2uKpzpM0eXy35fZl6WoJSlIv3akCnzdtLtaWAptzfXhgRSlF/33+gZ3jRcSP7ca2YpUviuZ+KYk+uGfMh092CMRMjPv1Et5h7zYGD+o= + file: "$DEPLOYFILE" + on: + repo: sfztools/sfizz + tags: true diff --git a/.travis/after_success.sh b/.travis/after_success.sh new file mode 100755 index 00000000..8acde8a9 --- /dev/null +++ b/.travis/after_success.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +export VERSION=$(git describe --tags) +if [ "$TRAVIS_OS_NAME" = "linux" ]; then + export DEPLOYFILE=Sfizz-$VERSION-x86_64.AppImage + wget -c -nv "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" + chmod +x linuxdeploy-x86_64.AppImage + for size in 16 32 48 128 256; do dirname="sfizz/usr/share/icons/hicolor/${size}x${size}/apps"; mkdir -p $dirname; cp ./resources/icons/icon_${size}px.png ./${dirname}/sfizz.png; done + ./linuxdeploy-x86_64.AppImage --appdir=sfizz --desktop-file=./resources/linux/sfizz.desktop --executable=./build/clients/sfizz_jack --output=appimage +elif [ "$TRAVIS_OS_NAME" = "osx" ]; then + export DEPLOYFILE=sfizz-$VERSION.dmg + mkdir ./output + cp -r /build/* ./output/ + cp ./resources/icons/icon.icns ./output/sfizz.app/Contents/Resources/ + hdiutil create /tmp/tmp.dmg -ov -volname "sfizz-$VERSION" -fs HFS+ -srcfolder "./output/" + hdiutil convert /tmp/tmp.dmg -format UDZO -o ./$DEPLOYFILE; +fi diff --git a/.travis/before_install.sh b/.travis/before_install.sh new file mode 100755 index 00000000..d806bf92 --- /dev/null +++ b/.travis/before_install.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +if [ "$TRAVIS_OS_NAME" = "linux" ]; then + wget https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh + sudo sh cmake-3.13.0-Linux-x86_64.sh --skip-license --prefix=/usr/local + export PATH="/usr/local/bin:$PATH" # FIXME +elif [ "$TRAVIS_OS_NAME" = "osx" ]; then + brew update + brew upgrade cmake +fi diff --git a/.travis/install.sh b/.travis/install.sh new file mode 100755 index 00000000..fff4aa8a --- /dev/null +++ b/.travis/install.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +if [ "$TRAVIS_OS_NAME" = "linux" ]; then + sudo apt-get install libasound2-dev libjack-jackd2-dev libsndfile1-dev +fi diff --git a/.travis/script.sh b/.travis/script.sh new file mode 100755 index 00000000..fa98dd09 --- /dev/null +++ b/.travis/script.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +if [ "$TRAVIS_OS_NAME" = "linux" ]; then + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 100 + gcc -v && g++ -v && cmake --version && /usr/local/bin/cmake --version && $SHELL --version + + mkdir build && cd build + /usr/local/bin/cmake -D CMAKE_BUILD_TYPE=Release -D SFIZZ_CLIENTS=ON .. + make -j$(nproc) +elif [ "$TRAVIS_OS_NAME" = "osx" ]; then + mkdir build && cd build + cmake -D CMAKE_BUILD_TYPE=Release -D SFIZZ_CLIENTS=ON -G Xcode .. + xcodebuild -project sfizz.xcodeproj -alltargets -configuration Release build +fi diff --git a/README.md b/README.md index 5db5060a..5c6fc71a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # sfizz +[![Travis](https://img.shields.io/travis/com/sfztools/sfizz.svg?label=Linux-macOS&style=popout&logo=travis)](https://travis-ci.com/sfztools/sfizz) +[![AppVeyor](https://img.shields.io/appveyor/ci/sfztools/sfizz.svg?label=Windows&style=popout&logo=appveyor)](https://ci.appveyor.com/project/sfztools/sfizz) + ## Building Sfizz depends on the `sndfile` library. @@ -37,4 +40,4 @@ If you already cloned the repository without the `--recursive` option, update th git submodule update --init --recursive ``` -You can build with `clang`, although in that case the CMakeFile defaults to using `libc++` instead of `libstdc++`. \ No newline at end of file +You can build with `clang`, although in that case the CMakeFile defaults to using `libc++` instead of `libstdc++`.