-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathazure-pipelines.yml
96 lines (74 loc) · 2.07 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
# Automatically increase all version numbers after the first field
name: 0.$(Year:yy).$(DayOfYear).$(Rev:r)
trigger:
- master
pr:
autoCancel: true
branches:
include:
- master
jobs:
- job: Package
displayName: Pre-test and package
pool:
vmImage: ubuntu-16.04
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: 3.7
displayName: 'Use Python 3.7'
- script: python -m reportabug
env:
PYTHONPATH: src
displayName: 'Basic test'
- script: pip install pytest-azurepipelines && pytest --test-run-title="Pre-tests"
displayName: 'Run unit tests against source'
- script: python setup.py sdist -d $(build.ArtifactStagingDirectory)
displayName: 'Build sdist'
- script: pip wheel reportabug --find-links $(build.ArtifactStagingDirectory) -w $(build.ArtifactStagingDirectory)
displayName: 'Build wheel'
- task: PublishPipelineArtifact@0
inputs:
artifactName: dist
targetPath: $(build.ArtifactStagingDirectory)
displayName: 'Publish dist to pipeline'
- template: azure-pipelines-test.yml
parameters:
vmImage: ubuntu-16.04
name: Ubuntu
- template: azure-pipelines-test.yml
parameters:
vmImage: macOS-10.13
name: macOS
- template: azure-pipelines-test.yml
parameters:
vmImage: vs2017-win2016
python.architecture: x64
name: Win64
- job: Publish
displayName: Publish to Azure Artifacts
dependsOn:
- Ubuntu
- macOS
- Win64
pool:
vmImage: vs2017-win2016
steps:
- checkout: none
- task: UsePythonVersion@0
inputs:
versionSpec: 3.7
displayName: 'Use Python 3.7'
- task: DownloadPipelineArtifact@0
inputs:
artifactName: dist
targetPath: $(Build.BinariesDirectory)/dist
displayName: "Download built package"
- script: pip install twine
displayName: 'Install Twine'
- task: TwineAuthenticate@0
inputs:
artifactFeeds: ReportABug
displayName: 'Configure Twine authentication'
- script: twine upload -r ReportABug --config-file $(PYPIRC_PATH) "$(Build.BinariesDirectory)/dist/*"
displayName: 'Upload to Artifacts'