-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |