Skip to content

Commit

Permalink
Azure pipelines rocks!
Browse files Browse the repository at this point in the history
  • Loading branch information
mottosso committed Aug 3, 2019
1 parent 8270726 commit 702a781
Showing 1 changed file with 130 additions and 0 deletions.
130 changes: 130 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
---
trigger:

# Already default, but made explicit here
branches:
include: ["*"]

# Ensure Azure triggers a build on a new tag
# We use these for GitHub releases
tags:
include: ["*"]

paths:
# Do not trigger a build on changes at these paths
exclude:
- docs/*
- .gitignore
- LICENSE.txt
- README.md


jobs:

# -----------------------------------------------------------------------
#
# Test
#
# -----------------------------------------------------------------------

- job: Ubuntu
pool:
vmImage: "ubuntu-16.04" # Xenial
strategy:
matrix:
Python27:
python.version: "2.7"
Python35:
python.version: "3.5"
Python36:
python.version: "3.6"
Python37:
python.version: "3.7"

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

- script: |
pip install .
displayName: "pip install"
- job: MacOS
pool:
vmImage: "macOS-10.13" # High-Sierra
strategy:
matrix:
Python27:
python.version: "2.7"
Python37:
python.version: "3.7"

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

- script: |
pip install .
displayName: "pip install"
- job: Windows
pool:
vmImage: vs2017-win2016
strategy:
matrix:
Python27:
python.version: "2.7"
Python37:
python.version: "3.7"

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "$(python.version)"
displayName: "Use Python $(python.version)"
- powershell: |
pip install .
displayName: "pip install"
# -----------------------------------------------------------------------
#
# Deploy to PyPI
#
# -----------------------------------------------------------------------

- job: Deploy
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
pool:
vmImage: "ubuntu-latest"
strategy:
matrix:
Python37:
python.version: "3.7"

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

- script: |
pip install wheel twine
python setup.py sdist bdist_wheel
echo [distutils] > ~/.pypirc
echo index-servers=pypi >> ~/.pypirc
echo [pypi] >> ~/.pypirc
echo username=$_LOGIN >> ~/.pypirc
echo password=$_PASSWORD >> ~/.pypirc
twine upload dist/*
displayName: "Deploy to PyPI"
# Decrypt secret variables provided by Azure web console
env:
_LOGIN: $(PYPI_LOGIN)
_PASSWORD: $(PYPI_PASSWORD)

0 comments on commit 702a781

Please sign in to comment.