-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
67 lines (67 loc) · 2.1 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
# azure-pipelines.yml - configuration for Azure Pipelines
# Copyright (C) 2020 Kaz Nishimura
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
# this notice are preserved. This file is offered as-is, without any warranty.
---
trigger:
- master
- release/*
- feature/*
stages:
- stage: Default
jobs:
- job: Build
pool:
vmImage: ubuntu-18.04
container: kazssym/python-prcs:3
steps:
- bash: |
pip install \
"setuptools>=38.6" \
unittest-xml-reporting \
wheel
displayName: Install build dependencies
- bash: |
pip install .
displayName: Install
- bash: |
python test/prepare.py test/testproject.prcs.b64 || exit $?
python -m xmlrunner discover -s test -o test-reports
displayName: Test
env:
PRCS_REPOSITORY: $(Agent.TempDirectory)/PRCS
- task: PublishTestResults@2
condition: succeededOrFailed()
- bash: |
python ./setup.py sdist
python ./setup.py bdist_wheel --universal
displayName: Create archives
- publish: dist
artifact: dist
- stage: Release
dependsOn: Default
condition:
and(succeeded(),
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))
jobs:
- job: Upload
displayName: Upload to PyPI
pool:
vmImage: ubuntu-latest
steps:
- download: current
artifact: dist
- task: UsePythonVersion@0
- task: TwineAuthenticate@1
inputs:
pythonUploadServiceConnection: pypi
- bash: |
pip install \
twine
displayName: Install upload tools
- bash: |
twine upload -r pypi --config-file $(PYPIRC_PATH) \
'$(Agent.BuildDirectory)'/dist/*
displayName: Upload