glest-source/.travis.yml
2019-04-22 20:57:36 +01:00

142 lines
5.3 KiB
YAML

# https://docs.travis-ci.com/user/customizing-the-build/
language: cpp
sudo: required
matrix:
include:
- os: linux
compiler: gcc
env: Tr_Compiler_Version="5"
- os: linux
compiler: gcc
env: Tr_Compiler_Version="6"
- os: linux
compiler: gcc
env: Tr_Compiler_Version="7"
- os: linux
compiler: gcc
env: Tr_Compiler_Version="8"
# clang
- os: linux
compiler: clang
env: Tr_Compiler_Version="default"
- os: linux
compiler: clang
env: Tr_Compiler_Version="6.0"
# osx
- os: osx
osx_image: xcode9.2
env: Tr_Xcode_Version="9.2"
- os: osx
osx_image: xcode10.1
env: Tr_Xcode_Version="10.1"
git:
submodules: false
before_install:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ./.travis-before_install.sh "$CC" "$Tr_Compiler_Version"; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install sdl2 lua fontconfig freetype ftgl libogg glew libvorbis cppunit glib fribidi miniupnpc wxmac; fi
# ^ not on travis also needed are: cmake + pkgconfig + xquartz (find by "search") + (maybe) git + (maybe) bash
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew outdated cmake || brew upgrade cmake; brew outdated pkgconfig || brew upgrade pkgconfig; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew link --force gettext; fi
# ^ odd linking problems related with brew which is not creating links
- if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$Tr_Xcode_Version" = "6.4" ]; then brew install Caskroom/cask/xquartz; fi
- if [ "$Tr_Compiler_Version" != "" ] && [ "$Tr_Compiler_Version" != "default" ] && [ "$CC" = "gcc" ]; then export CXX="g++-${Tr_Compiler_Version}" CC="gcc-${Tr_Compiler_Version}"; fi
- if [ "$Tr_Compiler_Version" != "" ] && [ "$Tr_Compiler_Version" != "default" ] && [ "$CC" == "clang" ]; then
export CXX="clang++-${Tr_Compiler_Version}" CC="clang-${Tr_Compiler_Version}";
fi
- $CC --version
- $CXX --version
- cmake --version
script: |
# ALL THE BUILD COMMANDS HERE
# version 6 skipped here. Below, it's used to test use of FORCE_EMBEDDED_LIBS option
if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" = "" ] && [ $Tr_Compiler_Version != "6" ]; then
mkdir build;
cd build;
cmake .. -DCMAKE_INSTALL_PREFIX=/usr;
fi
if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" != "" ]; then
mkdir build;
cd build;
cmake .. -DCMAKE_INSTALL_PREFIX=/usr;
fi
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
mkdir build;
cd build;
cmake .. -DCMAKE_INSTALL_PREFIX=/usr;
echo 'Dependencies:';
otool -L glest;
fi
if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" = "" ] && [ $Tr_Compiler_Version = "6" ]; then
mkdir build;
cd build;
cmake .. -DFORCE_EMBEDDED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr;
fi
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
make -j$(nproc) && make install DESTDIR=../Glest;
cd ..;
rm -rf build;
# Get the data for the appimage build.
git clone https://github.com/glest/glest-data.git;
mkdir build;
cd build;
cmake ../glest-data -DCMAKE_INSTALL_PREFIX=/usr;
make && make install DESTDIR=../Glest;
cd ..;
rm -rf build;
# Remove useless metainfo.
rm Glest/usr/share/metainfo/io.glest.Editor.appdata.xml;
find Glest/;
# Build the appimage.
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/pulseaudio/:/usr/lib/i386-linux-gnu/pulseaudio/:$LD_LIBRARY_PATH;
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="2.0"; # linuxdeployqt uses this for naming the file
./linuxdeployqt-continuous-x86_64.AppImage Glest/usr/share/applications/io.glest.Glest.desktop -appimage;
fi
# https://docs.travis-ci.com/user/notifications/#IRC-notification
notifications:
irc:
channels:
- "irc.freenode.org#glest-dev"
skip_join: true
use_notice: true
on_success: change
on_error: always
on_failure: change
template:
- "[%{repository_name}#%{branch}@%{commit}] %{author}: %{message} %{build_url}"
after_success:
# find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq # for debugging
# curl --upload-file APPNAME*.AppImage https://transfer.sh/APPNAME-git.$(git rev-parse --short HEAD)-x86_64.AppImage
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh Glest*.AppImage*
# Notify discord.
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh success $WEBHOOK_URL
after_failure:
# Notify discord.
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh failure $WEBHOOK_URL
branches:
except:
- # Do not build tags that we create when we upload to GitHub Releases
- /^(?i:continuous)/