forked from illuscio-dev/azure-pipelines-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish_library_python.yml
39 lines (34 loc) · 1.1 KB
/
publish_library_python.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
parameters:
# Artifact feed to pull custom packages from.
- name: pypiAzureArtifactFeed
type: string
# Publish to the public pypi.org
- name: publishToPypiOrg
type: boolean
steps:
# Release the package on our pypi
- script: python3 setup.py sdist bdist_wheel
displayName: Build package
# PUBLISH TO AZURE PRIVATE PYPI ###########
- ${{ if ne(parameters.pypiAzureArtifactFeed, '-') }}:
# Set up twine
- task: TwineAuthenticate@1
displayName: Authenticate Twine
inputs:
# In this case, name of the feed is 'myTestFeed'
artifactFeed: ${{ parameters.pypiAzureArtifactFeed }}
- script: |
twine upload \
-r ${{ parameters.pypiAzureArtifactFeed }} \
--config-file $(PYPIRC_PATH) \
dist/*
displayName: Upload package to azure pypi
# Publish to public pypi
- ${{ if parameters.publishToPypiOrg }}:
- script: |
twine upload dist/*
env:
TWINE_USERNAME: $(PYPIORG_USER)
TWINE_PASSWORD: $(PYPIORG_PASSWORD)
TWINE_NON_INTERACTIVE: 1
displayName: Upload package to pypi.org