cutter/.travis.yml
2018-10-02 14:32:22 +02:00

112 lines
5.0 KiB
YAML

language: cpp
cache: ccache
branches:
only:
- master
- debug
- /^v\d.*$/
- deploy-test
matrix:
include:
- os: linux
env: BUILD_SYSTEM=qmake DEPLOY=1
- os: linux
env: BUILD_SYSTEM=cmake
- os: osx
env: BUILD_SYSTEM=qmake DEPLOY=1
- os: osx
env: BUILD_SYSTEM=cmake
sudo: required
dist: trusty
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo add-apt-repository ppa:beineri/opt-qt596-trusty -y &&
sudo apt-get update -qq
; fi
install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew bundle --file=scripts/Brewfile ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="/usr/local/opt/qt/bin:$PATH" ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source scripts/prepare_python_macos.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get -y install qt59base qt59svg qt59webengine --allow-unauthenticated &&
source /opt/qt5*/bin/qt5*-env.sh
; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then source scripts/prepare_python_linux.sh ; fi
before_script:
- git submodule init ; git submodule update
- cd radare2
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
INSTALL_TARGET=install sys/install.sh;
else
LDFLAGS=-headerpad_max_install_names INSTALL_TARGET=install sys/install.sh;
fi
- cd ..
script:
- mkdir build
- cd build
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ "$BUILD_SYSTEM" == "qmake" ]]; then
PKG_CONFIG_PATH="$CUSTOM_PYTHON_PREFIX/lib/pkgconfig" qmake CUTTER_ENABLE_JUPYTER=true CUTTER_ENABLE_QTWEBENGINE=false PREFIX=/usr APPIMAGE=1 ../src && make -j4;
elif [[ "$BUILD_SYSTEM" == "qmake" ]]; then
cmake ../src && make -j4;
fi
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "$BUILD_SYSTEM" == "qmake" ]]; then
qmake CUTTER_ENABLE_JUPYTER=true CUTTER_ENABLE_QTWEBENGINE=false CUTTER_BUNDLE_R2_APPBUNDLE=true PYTHON_FRAMEWORK_DIR=$PYTHON_FRAMEWORK_DIR ../src &&
make -j4;
elif [[ "$BUILD_SYSTEM" == "qmake" ]]; then
cmake ../src && make -j4;
fi
fi
after_success:
- export CUTTER_VERSION=$(python ../scripts/get_version.py)
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
cp ../src/macos/Cutter.sh Cutter.app/Contents/MacOS/Cutter.sh && chmod +x Cutter.app/Contents/MacOS/Cutter.sh &&
macdeployqt Cutter.app -executable=Cutter.app/Contents/MacOS/Cutter &&
"$TRAVIS_BUILD_DIR/scripts/appbundle_embed_python.sh" "$PYTHON_FRAMEWORK_DIR/Python.framework" Cutter.app Cutter.app/Contents/MacOS/Cutter &&
mkdir -p Cutter.app/Contents/Resources/r2/share &&
cp -a /usr/local/share/radare2 Cutter.app/Contents/Resources/r2/share/ &&
mkdir image && cp -a Cutter.app image/ &&
export DMG_FILE="Cutter-v$CUTTER_VERSION.dmg" &&
hdiutil create -srcfolder image -volname Cutter -fs HFS+ "$DMG_FILE" &&
export FILE_TO_UPLOAD="$DMG_FILE"
; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
make INSTALL_ROOT=appdir install &&
cp -r /usr/share/radare2 appdir/usr/share/ &&
"$TRAVIS_BUILD_DIR/scripts/appimage_embed_python.sh" "$CUSTOM_PYTHON_PREFIX" appdir &&
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 &&
LD_LIBRARY_PATH=$CUSTOM_PYTHON_PREFIX/lib ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs -no-strip -exclude-libs=libnss3.so,libnssutil3.so -ignore-glob=usr/lib/python3.6/** -verbose=2 &&
LD_LIBRARY_PATH=$CUSTOM_PYTHON_PREFIX/lib ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -appimage -no-strip -exclude-libs=libnss3.so,libnssutil3.so -ignore-glob=usr/lib/python3.6/** -verbose=2 &&
find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq &&
export APPIMAGE_FILE="Cutter-v$CUTTER_VERSION-x86_64.AppImage" &&
mv Cutter-x86_64.AppImage "$APPIMAGE_FILE" &&
export FILE_TO_UPLOAD="$APPIMAGE_FILE"
; fi
deploy:
skip_cleanup: true
provider: releases
draft: true
tag_name: $TRAVIS_TAG
api_key:
secure: ZXuSX8JXyL0HlJvSIda3ftMkvYsrxoWDcWm2LxO+f0uNFghCHNnISuH/btdipn2mjCBaBQl6/1IK5cg/AZ5OSkiaVsJJqY8kkPsZvR8K+k4oarsr2ApetlLZiZWtydC3J+UyNhsgCt4iuYPsvusANFPZBpVmqT+A5CHS7aPIqP00awbkJYG1uOENe2XVZ0vyotBqU0E7A9f8UO5ps0+qysS8W+NDB+CGLgKLeBfCk3U+IYKGYXcv66xCmSSZ5f7IVIXEjG4voFHGp9XLRY2R/iJgiKQKDbu519vUB3iKPzmLTB/Q9bNz4VMZCREa4SHaLDen730fMHbfm6ZhGZDzXg1DgZoh6RHptWf0WjcHTr1ch8ajpnBMxh/qmoRpaS00FJQMraMT3Il38ekYd+hOhsP58Bj1Db2vjBKopGEHGmVyFQZKuynrdKmpmY+kRNUT3QerIsiAHwHV2QXnMARHYXJrM0T7LNACa2mhiwQD2vNIqLRieIbHbSWgDUrTVTDeII23AAHCzD0YxcCAjSExjun/rc9dJjevgCoBpTM/NHPLCW4big1myx+vRQGPNdlf+dI7igm6bPVWB7znp5uXlI8q5irvqTVtRSvKbcaeDWOz/ki7QgOzaxmGFtaw30hxeY0wFlnSMXc8m42udWLkp/l0b4L0hcoaMTc1TvVU0i4=
file:
- "${FILE_TO_UPLOAD}"
on:
tags: true
condition: $DEPLOY = 1