forked from tox-dev/azure-pipelines-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-pypi.yml
28 lines (27 loc) · 1.02 KB
/
publish-pypi.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
parameters:
external_feed: ""
pypi_remote: ""
dependsOn: []
jobs:
- job: publish
dependsOn: ${{ parameters.dependsOn }}
condition: succeeded()
pool: { vmImage: "ubuntu-latest" }
variables:
TMPDIR: $(Build.BinariesDirectory)
PIP_NO_WARN_SCRIPT_LOCATION: "0"
steps:
- task: UsePythonVersion@0
displayName: setup python
inputs: { versionSpec: "3.8" }
- task: TwineAuthenticate@0
inputs:
externalFeeds: ${{ parameters.external_feed}}
- script: "python -m pip install -U --user --force-reinstall twine pep517"
displayName: "acquire build tools"
- script: 'python -m pep517.build --binary --source --out-dir "$(System.DefaultWorkingDirectory)/w" .'
displayName: "build wheel and source distribution"
- script:
${{ format('python3.8 -m twine upload -r {0} --config-file $(PYPIRC_PATH)
"$(System.DefaultWorkingDirectory)/w/*"', parameters.pypi_remote) }}
displayName: "upload sdist and wheel to PyPi"