leocad/.travis.yml

100 lines
3.4 KiB
YAML
Raw Normal View History

2017-01-14 19:13:56 +01:00
language: cpp
matrix:
include:
- os: linux
dist: trusty
2019-03-09 20:35:35 +01:00
addons:
2019-03-09 20:59:01 +01:00
apt:
sources:
- sourceline: "ppa:beineri/opt-qt487-trusty"
packages:
2019-03-09 21:52:15 +01:00
- opt-qt4-qmake opt-qt4-dev-tools opt-libqt4-dev opt-libqt4-dev-bin opt-libqt4-opengl-dev
2017-01-14 19:13:56 +01:00
sudo: required
compiler: gcc
env:
- QT_BASE=48
- os: linux
dist: trusty
2019-03-09 20:59:01 +01:00
addons:
apt:
sources:
- sourceline: "ppa:beineri/opt-qt-5.10.1-trusty"
packages:
- qt510base
2017-01-14 19:13:56 +01:00
sudo: required
compiler: gcc
env:
2019-03-09 20:26:55 +01:00
- QT_BASE=510
2017-01-14 19:13:56 +01:00
- os: osx
compiler: clang
env:
- QT_BASE=57
before_install:
2019-03-11 23:33:43 +01:00
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
2017-01-14 19:13:56 +01:00
brew update;
fi
install:
2019-03-11 23:33:43 +01:00
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
2019-03-12 02:19:29 +01:00
brew install qt5 grep;
2019-03-09 20:26:55 +01:00
brew link --force qt5;
2020-09-08 01:26:40 +02:00
wget https://github.com/leozide/leocad/releases/download/v19.07.1/Library-Linux-14384.zip -O library.zip;
2019-03-11 23:33:43 +01:00
unzip library.zip;
fi
2017-01-14 19:13:56 +01:00
script:
2019-03-11 23:33:43 +01:00
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
source /opt/qt*/bin/qt*-env.sh
qmake PREFIX=/usr -v
qmake PREFIX=/usr -r
make -j$(nproc); export COMPILE_RESULT=$?
if [[ "$QT_BASE" != "510" ]]; then exit $COMPILE_RESULT; fi
2019-03-11 23:33:43 +01:00
make install INSTALL_ROOT=AppDir
2019-07-14 19:46:32 +02:00
if [[ "$TRAVIS_TAG" != "" ]]; then
wget https://github.com/leozide/leocad/releases/download/v18.02/Library-Linux-11494.zip -O library.zip;
unzip library.zip;
mkdir -p AppDir/usr/share/leocad;
mv library.bin AppDir/usr/share/leocad/library.bin;
fi
2019-03-11 23:33:43 +01:00
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt*.AppImage
unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
export VERSION=$(git rev-parse --short HEAD)
./linuxdeployqt*.AppImage ./AppDir/usr/share/applications/*.desktop -bundle-non-qt-libs
./linuxdeployqt*.AppImage --appimage-extract
export PATH=$(readlink -f ./squashfs-root/usr/bin/):$PATH
./squashfs-root/usr/bin/appimagetool AppDir/
mv ./LeoCAD-$VERSION-x86_64.AppImage ./LeoCAD-Linux-$VERSION-x86_64.AppImage
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
qmake PREFIX=/usr -v
qmake PREFIX=/usr -r
make -j$(sysctl -n hw.ncpu)
cd build/release
macdeployqt LeoCAD.app -dmg
mv LeoCAD.dmg LeoCAD-macOS-$(git rev-parse --short HEAD).dmg
fi
after_success:
- |
2019-03-12 01:58:03 +01:00
export GREP_PATH=grep;
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export GREP_PATH=ggrep; fi
curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/leozide/leocad/commits/master -o repo.txt;
2019-03-12 01:58:03 +01:00
export REMOTE=$($GREP_PATH -Po '(?<=: \")(([a-z0-9])\w+)(?=\")' -m 1 repo.txt);
export LOCAL=$(git rev-parse HEAD);
if [[ "$REMOTE" != "$LOCAL" ]]; then echo "Build no longer current. $REMOTE vs $LOCAL - aborting upload."; exit 0; fi;
if [[ "$QT_BASE" = "510" && "$TRAVIS_OS_NAME" = "linux" ]]; then
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
bash upload.sh LeoCAD*.AppImage*
2019-03-11 23:33:43 +01:00
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
bash upload.sh LeoCAD*.dmg*
fi
branches:
except:
- # Do not build tags that we create when we upload to GitHub Releases
- /^(?i:continuous)/