2018-04-14 12:23:42 +00:00
# Reference: https://andrewdolby.com/articles/2016/continuous-deployment-for-qt-applications/
2018-06-20 12:25:44 +00:00
notifications :
email : false
2018-04-14 12:23:42 +00:00
os : osx
language : cpp
matrix :
include :
2018-06-20 12:25:44 +00:00
- os : linux
dist : trusty
sudo : required
compiler : gcc
addons :
apt :
sources :
- ubuntu-toolchain-r-test
2018-04-14 12:23:42 +00:00
- os : osx
compiler : clang
2018-11-28 13:34:52 +00:00
osx_image : xcode9.3
2018-04-14 12:23:42 +00:00
install :
2018-06-27 00:19:14 +00:00
# (Mac) Install CGAL
2018-11-28 13:34:52 +00:00
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then HOMEBREW_VERBOSE_USING_DOTS=1 brew upgrade --verbose boost --without-single --without-static; fi
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then HOMEBREW_VERBOSE_USING_DOTS=1 brew reinstall --verbose cgal; fi
2018-06-27 00:19:14 +00:00
# (Linux) Prepare build environment
2018-06-20 12:25:44 +00:00
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository --yes ppa:beineri/opt-qt591-trusty; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi
2018-06-27 00:19:14 +00:00
#- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install gcc-4.9 g++-4.9; fi
2018-06-20 12:25:44 +00:00
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt install cmake; fi
2018-06-27 00:19:14 +00:00
# (Linux) Install CGAL
# (Linux) First install a maybe old version CGAL to resolve dependencies
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libcgal-dev; fi
# (Linux) Build from source
2018-06-20 12:25:44 +00:00
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/CGAL/cgal/releases/download/releases/CGAL-4.11.1/CGAL-4.11.1.zip; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then unzip CGAL-4.11.1.zip; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd CGAL-4.11.1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir build; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd build; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake ../; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo make install; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd ../../; fi
2018-06-27 00:19:14 +00:00
# (Mac) Install Qt5
2018-11-28 13:34:52 +00:00
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then HOMEBREW_VERBOSE_USING_DOTS=1 brew reinstall --verbose qt; fi
2018-06-27 00:19:14 +00:00
# (Linux) Install Qt5
2018-06-20 12:25:44 +00:00
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install qt59base qt59tools --force-yes; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then source /opt/qt59/bin/qt59-env.sh; fi
2018-06-27 00:19:14 +00:00
# Install Rust
2018-04-14 12:23:42 +00:00
- wget -O installrust.sh https://sh.rustup.rs
- sh installrust.sh -y
2018-06-20 12:25:44 +00:00
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="$HOME/.cargo/bin:/usr/local/opt/qt/bin:$(brew --prefix)/bin:$PATH"; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH="~/.cargo/bin:$PATH"; fi
2018-04-14 12:23:42 +00:00
script :
2018-06-27 00:19:14 +00:00
# Build Meshlite
2018-06-20 12:25:44 +00:00
- git clone https://github.com/huxingyi/meshlite.git || travis_terminate 1
2018-09-28 02:45:39 +00:00
- cd meshlite/ffi
2018-04-14 12:23:42 +00:00
- cargo build --release
2018-09-28 02:45:39 +00:00
- cd ../../
- cp meshlite/ffi/include/meshlite.h thirdparty/meshlite/meshlite.h || travis_terminate 1
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cp meshlite/ffi/target/release/libmeshlite_ffi.dylib thirdparty/meshlite/libmeshlite_ffi.dylib || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp meshlite/ffi/target/release/libmeshlite_ffi.so thirdparty/meshlite/libmeshlite_ffi.so || travis_terminate 1; fi
2018-06-27 00:19:14 +00:00
# Build Dust3D
2018-06-20 12:25:44 +00:00
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then qmake -config release || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then qmake -config release || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make || travis_terminate 1; fi
2018-06-27 00:19:14 +00:00
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make CXX="g++ -fext-numeric-literals" || travis_terminate 1; fi
2018-06-20 12:25:44 +00:00
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/thirdparty/meshlite || travis_terminate 1; fi
2018-06-27 00:19:14 +00:00
2018-12-01 03:44:25 +00:00
# Prepare tag name
2018-12-01 04:09:22 +00:00
- export TAG="$TRAVIS_TAG"
- if [[ "$TAG" == "" ]]; then export TAG=unstable; fi
2018-12-01 03:44:25 +00:00
2018-06-27 00:19:14 +00:00
# (Mac) Prepare dmg
2018-12-01 03:44:25 +00:00
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mv dust3d.app dust3d-$TAG.app || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then macdeployqt dust3d-$TAG.app -dmg || travis_terminate 1; fi
2018-06-27 00:19:14 +00:00
# (Linux) Prepare AppImage
# References:
# https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
# https://packages.ubuntu.com/search?suite=trusty&arch=amd64&mode=exactfilename&searchon=contents&keywords=libstdc%2B%2B.so.6
# https://github.com/darealshinji/AppImageKit-checkrt/issues/1
# https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/AppRun-patched-x86_64
# https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/exec-x86_64.so
# https://github.com/probonopd/audacity/blob/AppImage/.travis.yml
# https://discourse.appimage.org/t/im-a-big-fan-of-this-but-graphics-driver-libstdc-conflict/171
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p appdir/usr/share/metainfo || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p appdir/usr/share/applications || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p appdir/usr/bin || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p appdir/usr/optional/libstdc++ || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ldd --version; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ls /usr/lib/x86_64-linux-gnu/ | grep libstdc; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 appdir/usr/optional/libstdc++/libstdc++.so.6 || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/exec-x86_64.so appdir/usr/optional/exec.so || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/icon.png appdir/icon.png || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/dust3d.appdata.xml appdir/usr/share/metainfo/dust3d.appdata.xml || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./dust3d appdir/usr/bin/dust3d || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/dust3d.desktop appdir/usr/share/applications/dust3d.desktop || travis_terminate 1; fi
2018-06-20 12:25:44 +00:00
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod a+x ./ci/linuxdeployqt.AppImage || travis_terminate 1; fi
2018-06-27 00:19:14 +00:00
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then unset QTDIR; unset QT_PLUGIN_PATH ; export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/thirdparty/meshlite; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./ci/linuxdeployqt.AppImage appdir/usr/share/applications/dust3d.desktop -bundle-non-qt-libs -verbose=2 || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then rm appdir/AppRun || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/AppRun-patched-x86_64 appdir/AppRun || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod a+x appdir/AppRun || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./ci/linuxdeployqt.AppImage --appimage-extract || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH=$(readlink -f ./squashfs-root/usr/bin):$PATH || travis_terminate 1; fi
2018-12-01 03:44:25 +00:00
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./squashfs-root/usr/bin/appimagetool -g ./appdir/ dust3d-$TAG-x86_64.AppImage || travis_terminate 1; fi
2018-06-27 00:19:14 +00:00
# Distribute
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then echo "No distribution on pull request"; fi
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then travis_terminate 0; fi
2018-12-01 03:44:25 +00:00
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sh ci/upload-github-release-asset.sh github_api_token=${my_auth_token} branch=$TRAVIS_BRANCH owner=huxingyi repo=dust3d tag=$TAG filename=dust3d-$TAG.dmg; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then bash ci/upload-github-release-asset.sh github_api_token=${my_auth_token} branch=$TRAVIS_BRANCH owner=huxingyi repo=dust3d tag=$TAG filename=dust3d-$TAG-x86_64.AppImage; fi