sudo: required
language: python
addons:
  apt:
    packages:
    - libusb-1.0-0-dev
    - libudev-dev
matrix:
  include:
  - if: tag =~ .+
    os: osx
    language: ruby
    osx_image: xcode7.3
  - os: linux
    python: "3.4"
    services:
    - docker
  - if: NOT tag =~ .+
    os: linux
    python: "3.5"
  - if: NOT tag =~ .+
    os: linux
    python: "3.6"
before_install:
- source contrib/zclassic/travis/electrum_zclassic_version_env.sh
- echo electrum-zclassic version is $ELECTRUM_ZCL_VERSION
- mkdir -p build && cp contrib/zclassic/travis/* ./build/
- if [[ -n $TRAVIS_TAG ]] && [[ $TRAVIS_OS_NAME == 'osx' ]]; then
      ./build/before_install-osx.sh;
  fi
- if [[ -n $TRAVIS_TAG ]] && [[ $TRAVIS_OS_NAME == 'linux' ]] && [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then
      ./build/before_install-linux.sh;
  fi
- if [[ -n $TRAVIS_TAG ]] && [[ $TRAVIS_OS_NAME == 'linux' ]] && [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then
      ./build/before_install-linux-apk.sh;
  fi
install:
- if [[ -z $TRAVIS_TAG ]] && [[ $TRAVIS_OS_NAME == 'linux' ]]; then
      pip install tox; pip install tox-travis;
  fi
script:
- if [[ -z $TRAVIS_TAG ]] && [[ $TRAVIS_OS_NAME == 'linux' ]];then
      tox;
  fi
- if [[ -n $TRAVIS_TAG ]] && [[ $TRAVIS_OS_NAME == 'osx' ]]; then
      ./build/travis-build-osx.sh ;
  fi
- if [[ -n $TRAVIS_TAG ]] && [[ $TRAVIS_OS_NAME == 'linux' ]] && [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then
      ./build/travis-build-linux.sh;
  fi
- if [[ -n $TRAVIS_TAG ]] && [[ $TRAVIS_OS_NAME == 'linux' ]] && [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then
      ./build/travis-build-linux-apk.sh;
  fi
deploy:
- provider: releases
  api_key:
    secure: FuH5P/nqCXNTfgCCrK+34+InbCO7U14DhGPxhKyJl4KuimuRdsmcyD/IPTIyTJ7mkElg/x/wkj7g1r6ajajZPncYd7CoV3wlTSC/XN5EyotIFOw4dz6YssqhrkDGsms07sTTzeMdoXWqS02eiMYb3FzJn0Fd3Gk0YtF3PgqmQEkB0eh83G7cQSqUpcxcs2hOkQ0bDDsSad3AdJSG0dFDqrbdxEu1hzQZJ8v59cxiV4Wo7ya6MpNrX2egWpJR14vuEjI8rFh1ixx4gpw+RcQIi7KlAz/EOb9nE8CsumoDUOjql6COZotD4oqT6Q7puj84iz5OFD7XwJ3cedJkWSmz8eQBXrqOu2TVsfUcL3NPZ61tXcfKo2LEVZzj5NenZJ4I+3QvywyNpJsAIf/VtIi0KYMQd6I4J2C1Tdxg2zXR0bDDKF1DBMRyUdl5Twk+oRs+B2vXlgiCq/GE+FU4EhgPKSav8tZEYMvbX5ec2c/iX00GeIXtz8yXvf/KZAlUzJvvbYjYqH4OJTGq2RwwsPQ6HD7DvBDRtTo2+9lmtG0VQgyK/F+bNTIqBvWc/gQeV7BwpI/7SjWrWyIsN5n/J9b+bU1N1Q9NPqUw/070mgdJ147cOMFV9c/wWO2VoZKeYijIjWNtNQIusrPPyu2+4/ZfC8mOAvX9o3w5dqZdK2CVlNw=
  file:
  - build/electrum-zclassic/dist/electrum-zclassic-$ELECTRUM_ZCL_VERSION-macosx.dmg
  on:
    repo: ZclassicCommunity/electrum-zclassic
    tags: true
    condition: "$TRAVIS_OS_NAME = osx"
- provider: releases
  api_key:
    secure: FuH5P/nqCXNTfgCCrK+34+InbCO7U14DhGPxhKyJl4KuimuRdsmcyD/IPTIyTJ7mkElg/x/wkj7g1r6ajajZPncYd7CoV3wlTSC/XN5EyotIFOw4dz6YssqhrkDGsms07sTTzeMdoXWqS02eiMYb3FzJn0Fd3Gk0YtF3PgqmQEkB0eh83G7cQSqUpcxcs2hOkQ0bDDsSad3AdJSG0dFDqrbdxEu1hzQZJ8v59cxiV4Wo7ya6MpNrX2egWpJR14vuEjI8rFh1ixx4gpw+RcQIi7KlAz/EOb9nE8CsumoDUOjql6COZotD4oqT6Q7puj84iz5OFD7XwJ3cedJkWSmz8eQBXrqOu2TVsfUcL3NPZ61tXcfKo2LEVZzj5NenZJ4I+3QvywyNpJsAIf/VtIi0KYMQd6I4J2C1Tdxg2zXR0bDDKF1DBMRyUdl5Twk+oRs+B2vXlgiCq/GE+FU4EhgPKSav8tZEYMvbX5ec2c/iX00GeIXtz8yXvf/KZAlUzJvvbYjYqH4OJTGq2RwwsPQ6HD7DvBDRtTo2+9lmtG0VQgyK/F+bNTIqBvWc/gQeV7BwpI/7SjWrWyIsN5n/J9b+bU1N1Q9NPqUw/070mgdJ147cOMFV9c/wWO2VoZKeYijIjWNtNQIusrPPyu2+4/ZfC8mOAvX9o3w5dqZdK2CVlNw=
  file:
  - build/electrum-zclassic/dist/Electrum-Zclassic-$ELECTRUM_ZCL_VERSION.tar.gz
  - build/electrum-zclassic/dist/electrum-zclassic-$ELECTRUM_ZCL_VERSION-setup-win32.exe
  - build/electrum-zclassic/dist/electrum-zclassic-$ELECTRUM_ZCL_VERSION-setup-win64.exe
  - build/electrum-zclassic/bin/Electrum_Zclassic-$ELECTRUM_ZCL_APK_VERSION-release-unsigned.apk
  on:
    repo: ZclassicCommunity/electrum-zclassic
    tags: true
    condition: "$TRAVIS_OS_NAME = linux"
