Added Travis CI configuration.

This commit is contained in:
redtide 2019-09-18 09:13:36 +02:00 committed by paulfd
parent 4fe0cbab7f
commit d500c43541
6 changed files with 98 additions and 1 deletions

40
.travis.yml Normal file
View file

@ -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

19
.travis/after_success.sh Executable file
View file

@ -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

12
.travis/before_install.sh Executable file
View file

@ -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

7
.travis/install.sh Executable file
View file

@ -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

16
.travis/script.sh Executable file
View file

@ -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

View file

@ -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++`.
You can build with `clang`, although in that case the CMakeFile defaults to using `libc++` instead of `libstdc++`.