-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yaml
102 lines (102 loc) · 3.03 KB
/
azure-pipelines.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
trigger:
branches:
include:
- "*"
tags:
include:
- "v*"
pr:
branches:
include:
- '*'
resources:
repositories:
- repository: tox
type: github
endpoint: ngrewe
name: tox-dev/azure-pipelines-template
ref: refs/tags/0.2
stages:
- stage: test
displayName: Run Tests
jobs:
- template: run-tox-env.yml@tox
parameters:
tox_version: 'tox'
jobs:
'py37_black':
image: [linux]
'py37_mypy':
image: [linux]
'py37_django22':
image: [linux]
'py37_django30':
image: [linux]
'py37_django31':
image: [linux]
coverage:
with_toxenv: 'coverage'
for_envs: [py37_django22, py37_django30, py37_django31]
- stage: build
displayName: Build Packages
dependsOn: test
condition: succeeded()
pool:
vmImage: 'ubuntu-18.04'
jobs:
- job: python_dist
displayName: Build Python Distributions
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
architecture: 'x64'
- script: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
displayName: Install Build Tools
- script: |
export PATH=$HOME/.poetry/bin:$PATH
poetry build
displayName: Build Distributions
- publish: dist
name: python_dists
displayName: Publish Distributions
- stage: publish
displayName: Publish Packages
dependsOn: build
condition: and(succeeded(), startsWith(variables['build.sourceBranch'], 'refs/tags/'))
pool:
vmImage: 'ubuntu-18.04'
jobs:
- job: pypi_publish
displayName: Publish PyPi Packages
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
architecture: 'x64'
- script: python -m pip install twine
displayName: Install Publishing Tools
- download: current
artifact: build.pythondist
displayName: Download Python Distributions
- task: TwineAuthenticate@1
displayName: Authenticate PyPi Service Connection
inputs:
pythonUploadServiceConnection: 'Azure PyPi'
- script: |
python -m twine upload --skip-existing --verbose --repository azure-pypi --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/build.pythondist/*.*
displayName: Publish to PyPi
- job: github_publish
displayName: Publish Github Release
steps:
- download: current
displayName: Download Distributions
- task: GithubRelease@0
displayName: 'Create GitHub Release'
inputs:
gitHubConnection: github.com_ngrewe
repositoryName: ngrewe/django-faucet-pipeline
assets: |
$(Pipeline.Workspace)/build.pythondist/*