yubioath-flutter/.travis.yml

135 lines
5.7 KiB
YAML
Raw Normal View History

2017-03-01 17:36:28 +03:00
# .travis.yml
# Building, testing and deployment on OS X and Linux
# Reference: https://docs.travis-ci.com/user/customizing-the-build
language: cpp
sudo: required
2017-09-15 11:41:17 +03:00
env:
- PY_VERSION="3.6.2"
2017-03-01 17:36:28 +03:00
os:
- osx
2017-03-09 15:00:18 +03:00
- linux
services:
- docker
2017-03-01 17:36:28 +03:00
before_install:
2017-03-09 15:00:18 +03:00
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]
then
cd vendor/yubikey-manager && docker build -t ykman-xenial -f docker/xenial/Dockerfile .
id=$(docker create ykman-xenial)
docker cp $id:/yubikey-manager-debian-packages.tar.gz ykman-deb.tar.gz
docker build -t yubioath-xenial -f docker/xenial/Dockerfile .
2017-03-09 15:00:18 +03:00
fi
2017-03-01 17:36:28 +03:00
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]
then
export MACOSX_DEPLOYMENT_TARGET=10.9
brew update
# Patch PyOtherSide to not be built with debug output
echo "DEFINES += QT_NO_DEBUG_OUTPUT" >> vendor/pyotherside/src/src.pro
fi
2017-09-15 14:16:07 +03:00
- pip install --upgrade pip
2017-03-01 17:36:28 +03:00
install:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]
then
2017-09-15 11:35:54 +03:00
git clone https://github.com/aurelien-rainone/macdeployqtfix.git
2017-03-01 17:36:28 +03:00
brew install qt5 swig
brew link qt5 -f
brew install ykpers libyubikey hidapi libu2f-host libusb
# Build Python 3 with --enable-framework, to be able to distribute it in a .app bundle
2017-04-21 14:54:53 +03:00
brew upgrade pyenv
2017-03-01 17:36:28 +03:00
eval "$(pyenv init -)"
2017-09-15 11:41:17 +03:00
env PYTHON_CONFIGURE_OPTS="--enable-framework CC=clang" pyenv install $PY_VERSION
pyenv global system $PY_VERSION
2017-04-21 14:43:01 +03:00
pip install --upgrade pip
2017-03-01 17:36:28 +03:00
# Build and install PyOtherside
cd vendor/pyotherside
qmake
make
sudo make install
cd ../../
fi
2017-03-09 13:50:21 +03:00
# Install linting tools
2017-09-11 12:13:49 +03:00
- sudo pip install pre-commit flake8
2017-03-01 17:36:28 +03:00
before_script:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]
then
pre-commit run --all-files
fi
script:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]
then
qmake
make
fi
after_success:
- mkdir deploy/
# Exctract all user facing strings and create a textfile with them for deployment.
- lupdate yubioath-desktop.pro -ts yubioath-desktop.ts
2017-09-13 14:59:19 +03:00
- cp yubioath-desktop.ts deploy/yubioath-desktop-$TRAVIS_BRANCH-strings.xml
2017-03-01 17:36:28 +03:00
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]
then
macdeployqt yubioath-desktop.app/ -qmldir=qml/
# Copy needed dylibs
find /usr/local/Cellar/json-c/ -name '*.dylib' -exec cp '{}' yubioath-desktop.app/Contents/Frameworks/ ';'
find /usr/local/Cellar/ykpers/ -name '*.dylib' -exec cp '{}' yubioath-desktop.app/Contents/Frameworks/ ';'
find /usr/local/Cellar/libyubikey/ -name '*.dylib' -exec cp '{}' yubioath-desktop.app/Contents/Frameworks/ ';'
2017-03-03 12:12:08 +03:00
find /usr/local/Cellar/hidapi/ -name '*.dylib' -exec cp '{}' yubioath-desktop.app/Contents/Frameworks/ ';'
2017-03-01 17:36:28 +03:00
find /usr/local/Cellar/libu2f-host/ -name '*.dylib' -exec cp '{}' yubioath-desktop.app/Contents/Frameworks/ ';'
find /usr/local/Cellar/libusb/ -name '*.dylib' -exec cp '{}' yubioath-desktop.app/Contents/Frameworks/ ';'
2017-05-02 14:44:37 +03:00
find /usr/local/Cellar/openssl/ -name '*.dylib' -exec cp '{}' yubioath-desktop.app/Contents/Frameworks/ ';'
2017-03-01 17:36:28 +03:00
# Copy Python framework
2017-09-15 11:41:17 +03:00
cp -a ~/.pyenv/versions/$PY_VERSION/Python.framework yubioath-desktop.app/Contents/Frameworks/
2017-03-01 17:36:28 +03:00
sudo find yubioath-desktop.app/Contents/Frameworks/Python.framework -name '*.pyc' -delete
sudo find yubioath-desktop.app/Contents/Frameworks/Python.framework -name '__pycache__' -delete
# Move pymodules from app bundle to site-packages, to be accepted by codesign
2017-04-21 13:51:06 +03:00
mv yubioath-desktop.app/Contents/MacOS/pymodules/* yubioath-desktop.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/
2017-06-29 15:26:31 +03:00
rm -rf yubioath-desktop.app/Contents/MacOS/pymodules
2017-03-01 17:36:28 +03:00
# Fix stuff that macdeployqt does incorrectly.
sudo python macdeployqtfix/macdeployqtfix.py yubioath-desktop.app/Contents/MacOS/yubioath-desktop /usr/local
# Fix linking for PyOtherSide
2017-09-15 11:41:17 +03:00
sudo install_name_tool -change /Users/travis/.pyenv/versions/$PY_VERSION/Python.framework/Versions/3.6/Python @executable_path/../Frameworks/Python.framework/Versions/3.6/Python yubioath-desktop.app/Contents/Resources/qml/io/thp/pyotherside/libpyothersideplugin.dylib
2017-05-02 15:51:34 +03:00
# Fix linking for Python _ssl
2017-05-02 16:28:07 +03:00
sudo install_name_tool -change /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib @executable_path/../Frameworks/libcrypto.1.0.0.dylib yubioath-desktop.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so
sudo install_name_tool -change /usr/local/opt/openssl/lib/libssl.1.0.0.dylib @executable_path/../Frameworks/libssl.1.0.0.dylib yubioath-desktop.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so
2017-05-09 14:25:46 +03:00
# Fix linking for Python _hashlib
sudo install_name_tool -change /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib @executable_path/../Frameworks/libcrypto.1.0.0.dylib yubioath-desktop.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_hashlib.cpython-36m-darwin.so
sudo install_name_tool -change /usr/local/opt/openssl/lib/libssl.1.0.0.dylib @executable_path/../Frameworks/libssl.1.0.0.dylib yubioath-desktop.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_hashlib.cpython-36m-darwin.so
2017-03-01 17:36:28 +03:00
# Copy .app to deploy dir
2017-09-13 14:59:19 +03:00
tar -czf deploy/yubioath-desktop-$TRAVIS_BRANCH.app.tar yubioath-desktop.app
2017-03-01 17:36:28 +03:00
fi
2017-03-09 15:00:18 +03:00
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]
then
id=$(docker create xenial)
docker cp $id:/yubioath-desktop-debian-packages.tar.gz deploy/yubioath-desktop-$TRAVIS_BRANCH-deb.tar.gz
2017-03-09 15:00:18 +03:00
fi
2017-03-01 17:36:28 +03:00
deploy:
provider: s3
access_key_id: "$AWS_KEY_ID"
secret_access_key: "$AWS_SECRET_KEY"
bucket: "$AWS_BUCKET"
skip_cleanup: true
acl: public-read
region: eu-west-1
local-dir: "deploy/"
upload-dir: "yubioath-desktop"
on:
all_branches: true