-
Notifications
You must be signed in to change notification settings - Fork 120
/
.travis.yml
74 lines (68 loc) · 3.32 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
language: cpp
sudo: required
dist: trusty
matrix:
include:
- os: linux
compiler: gcc
- os: freebsd
compiler: clang
- os: osx
osx_image: xcode10.1
compiler: clang
install:
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
sudo apt-get -y install qt5-default qttools5-dev qttools5-dev-tools libfuse-dev libmagic-dev libtag1-dev libssl-dev
elif [ "${TRAVIS_OS_NAME}" = "freebsd" ]; then
sudo pkg install -y ninja qt5-qmake qt5-buildtools qt5-widgets qt5-linguist fusefs-libs pybind11 taglib
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
export HOMEBREW_NO_AUTO_UPDATE=1
brew tap homebrew/cask
brew install qt5 homebrew/cask/osxfuse pybind11 taglib openssl@1.1
fi
script:
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr &&
make -j$(nproc) &&
make DESTDIR=appdir -j$(nproc) install ; find appdir/ &&
sed -i -e 's|^Name=.*|Name=Android File Transfer|g' appdir/usr/share/applications/android-file-transfer.desktop &&
wget -c -q "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-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -bundle-non-qt-libs &&
./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -appimage
elif [ "${TRAVIS_OS_NAME}" = "freebsd" ]; then
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DUSB_BACKEND_LIBUSB=YES -DBUILD_PYTHON=OFF
cmake --build build
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
mkdir build &&
cd build &&
cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1 -DOPENSSL_LIBRARIES=/usr/local/opt/openssl@1.1/lib -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir &&
make -j$(sysctl -n hw.ncpu) &&
make install &&
mv installdir/android-file-transfer.app installdir/Android\ File\ Transfer\ for\ Linux.app &&
git clone https://github.com/andreyvit/create-dmg.git &&
cd create-dmg &&
./create-dmg --volicon "../../osx/android-file-transfer.icns" --icon-size 96 --icon "Android File Transfer for Linux" 110 100 --app-drop-link 380 100 AndroidFileTransferForLinux.dmg ../installdir/Android\ File\ Transfer\ for\ Linux.app
fi
after_success:
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq &&
wget https://github.com/d1vanov/ciuploadtool/releases/download/continuous-master/ciuploadtool_linux.zip &&
unzip ciuploadtool_linux.zip &&
chmod 755 ciuploadtool &&
./ciuploadtool ./Android*.AppImage*
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
wget https://github.com/d1vanov/ciuploadtool/releases/download/continuous-master/ciuploadtool_mac.zip &&
unzip ciuploadtool_mac.zip &&
chmod 755 ciuploadtool &&
./ciuploadtool AndroidFileTransferForLinux.dmg
fi
branches:
only:
- master
- /^v\d+\.\d+$/