-
Notifications
You must be signed in to change notification settings - Fork 3
/
azure-template-publish-job.yml
62 lines (59 loc) · 2.16 KB
/
azure-template-publish-job.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
# File: azure-template-publish-job.yml
# Date: 8-Jul-2019 jdw split out from original pipeline
#
# Update:
# 6-Aug-2019 jdw push source wheels (universal) for linux
# 11-Jan-2023 aae update MacOS version
#
##
parameters:
tox: ""
python: ""
os: "linux"
fixtures: ""
jobs:
- job: ${{ format('publish_{0}_{1}', parameters.tox, parameters.os) }}
pool:
${{ if eq(parameters.os, 'macos') }}:
vmImage: 'macOS-latest'
${{ if eq(parameters.os, 'linux') }}:
vmImage: 'ubuntu-latest'
dependsOn:
- ${{ format('build_test_{0}_{1}', parameters.tox, parameters.os) }}
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
#
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ parameters.python }}
addToPath: true
displayName: setup python
#
#- checkout: self
# submodules: true
#
- download: current
artifact: ${{ format('sw_{0}_{1}', parameters.tox, parameters.os) }}
- download: current
artifact: ${{ format('sw_u_{0}_{1}', parameters.tox, parameters.os) }}
#
- script: ls -lR $(Pipeline.Workspace)/${{ format('sw_{0}_{1}', parameters.tox, parameters.os) }}
displayName: "Listing of downloaded artifacts"
#
- script: python -m pip install --upgrade pip twine setuptools wheel
displayName: 'Install packaging tools'
#
- task: DownloadSecureFile@1
name: pypicred
displayName: 'Download PyPI credentials'
inputs:
secureFile: 'PYPIRC-AZURE'
- ${{ if startsWith(parameters.os, 'linux') }}:
- script: twine upload --verbose --skip-existing -r pypi --config-file $(pypicred.secureFilePath) $(Pipeline.Workspace)/${{ format('sw_u_{0}_{1}', parameters.tox, parameters.os) }}/*
displayName: "Linux upload sdist and source wheel to PyPi ..."
continueOnError: true
#
- ${{ if startsWith(parameters.os, 'macos') }}:
- script: twine upload --verbose --skip-existing -r pypi --config-file $(pypicred.secureFilePath) $(Pipeline.Workspace)/${{ format('sw_{0}_{1}', parameters.tox, parameters.os) }}/*
displayName: "Mac upload sdist and binary wheel to PyPi ..."
continueOnError: true