Labrador/.travis.yml

103 lines
4.0 KiB
YAML

language: cpp
matrix:
include:
- os: linux
dist: trusty
sudo: required
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- gcc-7
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- os: osx
osx_image: xcode7.2
compiler: clang
before_install:
- eval "${MATRIX_EVAL}"
- |
# OSX
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
# Linux
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo add-apt-repository ppa:beineri/opt-qt593-trusty -y
sudo apt-get update -qq
fi
install:
- |
# OSX
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew install qt5
brew link qt5 --force
#brew install libusb
#brew install wget
# Linux
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get -y install qt59base libusb-1.0-0-dev
source /opt/qt*/bin/qt*-env.sh
fi
script:
- |
# OSX
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
cd Desktop_Interface
qmake CONFIG+=release PREFIX=/usr DEFINES+=GIT_HASH_SHORT=$(git rev-parse --short HEAD)
make -j$(sysctl -n hw.ncpu)
mkdir -p bin/Labrador.app/Contents/MacOS/Resources
mkdir -p bin/Labrador.app/Contents/Frameworks
cp -r bin/firmware bin/Labrador.app/Contents/MacOS
cp -r bin/waveforms bin/Labrador.app/Contents/MacOS
cp ../build_scripts/osx/iconfile.icns bin/Labrador.app/Contents/Resources
cp ../build_scripts/osx/Info.plist bin/Labrador.app/Contents
macdeployqt bin/Labrador.app -dmg -libpath=build_mac/libdfuprog/lib/
#Linux
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
cd Desktop_Interface
qmake "PORTABLE=1" CONFIG+=release PREFIX=/usr DEFINES+=GIT_HASH_SHORT=$(git rev-parse --short HEAD)
make -j$(nproc) CXX=${CXX} CC=${CC} LINK=${CXX}
make INSTALL_ROOT=appdir -j$(nproc) install ; find appdir/
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
export VERSION=$(git rev-parse --short HEAD)
./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -bundle-non-qt-libs -verbose=2
# Workaround to increase compatibility with older systems; see https://github.com/darealshinji/AppImageKit-checkrt for details
mkdir -p appdir/usr/optional/ ; wget -c https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/exec-x86_64.so -O ./appdir/usr/optional/exec.so
mkdir -p appdir/usr/optional/libstdc++/ ; cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./appdir/usr/optional/libstdc++/
( cd appdir ; rm AppRun ; wget -c https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/AppRun-patched-x86_64 -O AppRun ; chmod a+x AppRun)
# Manually invoke appimagetool so that libstdc++ gets bundled and the modified AppRun stays intact
./linuxdeployqt*.AppImage --appimage-extract
export PATH=$(readlink -f ./squashfs-root/usr/bin):$PATH
./squashfs-root/usr/bin/appimagetool -g ./appdir/
fi
after_success:
- |
# OSX
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export UPLOADTOOL_SUFFIX=osx-dmg
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
bash upload.sh bin/Labrador.dmg
# Linux
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export UPLOADTOOL_SUFFIX=linux-appimage
find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
# curl --upload-file EspoTek_Labrador*.AppImage https://transfer.sh/EspoTek_Labrador-git.$(git rev-parse --short HEAD)-x86_64.AppImage
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
bash upload.sh EspoTek_Labrador*.AppImage*
fi
branches:
except:
- # Do not build tags that we create when we upload to GitHub Releases
- /^(?i:continuous)/