From 27ff00d7973d1e43e4b7e5c25b392469127e3bad Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 10 Feb 2019 12:56:51 -0800 Subject: [PATCH] segmented travis --- .travis.yml | 44 +++++++++++++-------------------------- .travis/after_success.sh | 15 +++++++++++++ .travis/before_install.sh | 9 ++++++++ .travis/install.sh | 10 +++++++++ .travis/script.sh | 30 ++++++++++++++++++++++++++ 5 files changed, 79 insertions(+), 29 deletions(-) create mode 100644 .travis/after_success.sh create mode 100644 .travis/before_install.sh create mode 100644 .travis/install.sh create mode 100644 .travis/script.sh diff --git a/.travis.yml b/.travis.yml index 26f5e8c42..f5d777dd7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,44 +1,30 @@ language: cpp -compiler: gcc -sudo: require -dist: trusty matrix: include: - - env: ARCH=x86_64 - - env: ARCH=i386 + - os: linux + env: ARCH=x86_64 + compiler: gcc + sudo: require + dist: trusty + - os: linux + env: ARCH=i386 + compiler: gcc + sudo: require + dist: trusty + - os: osx before_install: - - sudo add-apt-repository ppa:beineri/opt-qt593-trusty -y - - sudo add-apt-repository ppa:jonathonf/ffmpeg-3 -y - - sudo apt-get update -qq + - bash ./.travis/before_install.sh install: - - if [ "$ARCH" == "x86_64" ]; then sudo apt-get -y install qt59base qt59multimedia libavformat-dev libavcodec-dev libavfilter-dev libavutil-dev libswscale-dev libswresample-dev frei0r-plugins-dev frei0r-plugins fuse; fi - - if [ "$ARCH" == "i386" ]; then sudo apt-get -y install gcc-multilib g++-multilib qt59base:i386 qt59multimedia:i386 libavformat-dev:i386 libavcodec-dev:i386 libavfilter-dev:i386 libavutil-dev:i386 libswscale-dev:i386 libswresample-dev:i386 frei0r-plugins-dev:i386 frei0r-plugins:i386 pkg-config:i386 libgl1-mesa-dev:i386 fuse:i386; fi - - source /opt/qt*/bin/qt*-env.sh + - bash ./.travis/install.sh script: - - lrelease olive.pro - - if [ "$ARCH" == "x86_64" ]; then qmake CONFIG+=release PREFIX=/usr; fi - - if [ "$ARCH" == "i386" ]; then qmake CONFIG+=release "QMAKE_CFLAGS+=-m32" "QMAKE_CXXFLAGS+=-m32" "QMAKE_LFLAGS+=-m32" PREFIX=/usr -spec linux-g++-32; fi - - make -j$(nproc) - - make INSTALL_ROOT=appdir -j$(nproc) install ; find appdir/ - - mkdir -p appdir/usr/bin/ ; cp olive-editor appdir/usr/bin/ # FIXME; "make install" should do this - - 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 uses this for naming the file - - ./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -appimage - - if [ "$ARCH" == "i386" ]; then rm Olive*.AppImage; wget -c -nv "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-i686.AppImage"; chmod a+x appimagetool-i686.AppImage; ./appimagetool-i686.AppImage 'appdir' -n -g; fi + - bash ./.travis/script.sh after_success: - - find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq - - # curl --upload-file Olive*.AppImage https://transfer.sh/Olive-git.$(git rev-parse --short HEAD)-$ARCH.AppImage - - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - # only create release for master - - if [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi - - bash upload.sh Olive*.AppImage* + - bash ./.travis/after_success.sh branches: except: diff --git a/.travis/after_success.sh b/.travis/after_success.sh new file mode 100644 index 000000000..c6fbeb4a6 --- /dev/null +++ b/.travis/after_success.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +if [[ $TRAVIS_OS_NAME == 'osx' ]]; then + wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh + upload.sh Olive*.zip +elif [[ $TRAVIS_OS_NAME == 'linux' ]]; then + find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq + # curl --upload-file Olive*.AppImage https://transfer.sh/Olive-git.$(git rev-parse --short HEAD)-$ARCH.AppImage + wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh + # only create release for master + if [ "$TRAVIS_BRANCH" != "master" ]; then + export TRAVIS_EVENT_TYPE=pull_request + fi + upload.sh Olive*.AppImage* +fi \ No newline at end of file diff --git a/.travis/before_install.sh b/.travis/before_install.sh new file mode 100644 index 000000000..2fb95c978 --- /dev/null +++ b/.travis/before_install.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +if [[ $TRAVIS_OS_NAME == 'osx' ]]; then + brew install ffmpeg qt5 +elif [[ $TRAVIS_OS_NAME == 'linux' ]]; then + sudo add-apt-repository ppa:beineri/opt-qt593-trusty -y + sudo add-apt-repository ppa:jonathonf/ffmpeg-3 -y + sudo apt-get update -qq +fi \ No newline at end of file diff --git a/.travis/install.sh b/.travis/install.sh new file mode 100644 index 000000000..8dd271ec9 --- /dev/null +++ b/.travis/install.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [[ $TRAVIS_OS_NAME == 'osx' ]]; then + brew install ffmpeg qt5 +elif [[ $TRAVIS_OS_NAME == 'linux' ]]; then + if [ "$ARCH" == "x86_64" ]; then sudo apt-get -y install qt59base qt59multimedia libavformat-dev libavcodec-dev libavfilter-dev libavutil-dev libswscale-dev libswresample-dev frei0r-plugins-dev frei0r-plugins fuse; fi + if [ "$ARCH" == "i386" ]; then sudo apt-get -y install gcc-multilib g++-multilib qt59base:i386 qt59multimedia:i386 libavformat-dev:i386 libavcodec-dev:i386 libavfilter-dev:i386 libavutil-dev:i386 libswscale-dev:i386 libswresample-dev:i386 frei0r-plugins-dev:i386 frei0r-plugins:i386 pkg-config:i386 libgl1-mesa-dev:i386 fuse:i386; fi + source /opt/qt*/bin/qt*-env.sh +fi + diff --git a/.travis/script.sh b/.travis/script.sh new file mode 100644 index 000000000..6a6612e68 --- /dev/null +++ b/.travis/script.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +if [[ $TRAVIS_OS_NAME == 'osx' ]]; then + lrelease olive.pro + qmake CONFIG+=release PREFIX=/usr + make -j$(nproc) + macdeployqt Olive.app + zip -r Olive-$(git rev-parse --short HEAD)-macOS.zip Olive.app +elif [[ $TRAVIS_OS_NAME == 'linux' ]]; then + lrelease olive.pro + if [ "$ARCH" == "i386" ]; then + qmake CONFIG+=release "QMAKE_CFLAGS+=-m32" "QMAKE_CXXFLAGS+=-m32" "QMAKE_LFLAGS+=-m32" PREFIX=/usr -spec linux-g++-32; fi + else + qmake CONFIG+=release PREFIX=/usr + fi + make -j$(nproc) + 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 uses this for naming the file + ./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -appimage + if [ "$ARCH" == "i386" ]; then + rm Olive*.AppImage + wget -c -nv "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-i686.AppImage" + chmod a+x appimagetool-i686.AppImage + ./appimagetool-i686.AppImage 'appdir' -n -g + fi +fi +