queue:
  name: Hosted Ubuntu 1604
  timeoutInMinutes: 6000

trigger:
  batch: true
  branches:
    include:
    - master

pr: none

variables:
  python.version: '3.7'

steps:

- task: UsePythonVersion@0
  displayName: 'Use Python $(python.version)'
  inputs:
    versionSpec: '$(python.version)'

- script: 'git describe --exact-match --tags HEAD'
  displayName: 'Fail build on non-release commits'

- script: 'azure/install_dependencies.sh && pip install nose coverage twine wheel'
  displayName: 'Install dependencies'

- script: './download.sh'
  displayName: 'Download data files'

- script: 'python setup.py nosetests'
  displayName: Unit tests

- script: 'python setup.py bdist bdist_wheel && twine upload -u $(pypi_username) -p $(pypi_password) dist/*'
  displayName: PYPI deploy
