This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
forked from newrelic/newrelic-telemetry-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
140 lines (123 loc) · 4.23 KB
/
azure-pipelines.yml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
variables:
- group: pypi-info
trigger:
branches:
include:
- master
- refs/tags/v*
exclude:
- gh-pages
stages:
- stage: Test
jobs:
- job: Linux
pool:
vmImage: 'Ubuntu-16.04'
strategy:
matrix:
Python27:
containerImage: python:2.7
Python35:
containerImage: python:3.5
Python36:
containerImage: python:3.6
Python37:
containerImage: python:3.7
Python38:
containerImage: python:3.8
PyPy:
containerImage: pypy:2.7
PyPy3:
containerImage: pypy:3.6
container: $[ variables['containerImage'] ]
steps:
- script: |
python=$(which pypy || which pypy3 || which python)
$python -m pip install --upgrade pip setuptools tox --user
- script: |
python=$(which pypy || which pypy3 || which python)
$python -m tox -epy
displayName: 'Tox'
- job: Windows
pool:
vmImage: 'windows-2019'
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: |
python -m pip install --upgrade pip setuptools tox
displayName: 'Install dependencies'
- script: |
tox -epy
displayName: 'Tox'
- stage: Lint
dependsOn: []
jobs:
- job: Lint
pool:
vmImage: 'Ubuntu-16.04'
container: python:3.8
steps:
- script: |
python -m pip install --upgrade pip setuptools tox --user
displayName: 'Install dependencies'
- script: |
python -m tox -elint
displayName: 'Tox'
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
- stage: Deploy
dependsOn: [Test, Lint]
condition: succeeded()
jobs:
- job: pypi
pool:
vmImage: 'Ubuntu-16.04'
container: python:3.8
steps:
- script: |
python setup.py sdist bdist_wheel
python -m pip install --user --upgrade twine
python -m twine upload dist/*
env:
TWINE_USERNAME: $(TWINE_USERNAME)
TWINE_PASSWORD: $(TWINE_PASSWORD)
TWINE_REPOSITORY_URL: $(TWINE_REPOSITORY_URL)
displayName: 'Push to Python Package Index'
- job: docs
dependsOn: pypi
pool:
vmImage: 'Ubuntu-16.04'
container: python:3.8
steps:
- task: InstallSSHKey@0
inputs:
hostName: 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=='
sshPublicKey: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFJni31fgrXUYAq1bwM7XD8oCc5nCpv83IP52/GMaimakRv5mUUoTGJA4N/3WjNyB5rGrbvcB7T2bFpvsznibQpMuKYCf+Z0ziY1hMdaV3BcjD8hLuEUUSQ1KtIcZqONcvFEbATd2kyhWB2P8ixQrHEeaZ7REr/ftCsn9vGcso0RPz5G3PebkEBZusmeH9lZPzi3CFJdqgl/+U88GuIDze3wDU9vAFOx/vLGVAd7SiM+TlrJ2LlIAtXxFmRkGn2yQhHv6by0Mjt87EyK9Fx/LY/JTtrd2mAiZoxuIDLb0tQZHTMqnPuoHYh0C2PL9yvxMUMSlcDFg1M/EnVgO/2i9N'
sshKeySecureFile: 'newrelic-telemetry-sdk-python#deploy_key'
- script: |
git config --local user.name "Azure Pipelines"
git config --local user.email "bot@bot.localhost"
git remote add upstream git@github.com:newrelic/newrelic-telemetry-sdk-python.git
git fetch upstream gh-pages && git worktree add -B gh-pages docs/_build upstream/gh-pages
displayName: 'Prepare git directory for docs'
- script: |
python -m pip install --upgrade pip setuptools tox --user
displayName: 'Install dependencies'
- script: |
python -m tox -edocs
displayName: 'Generate docs'
- script: |
cd docs/_build && git add --all && git commit -m "Publishing docs to gh-pages" && git push
displayName: 'Publish Docs'