This repository was archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpython_publish_package.yml
More file actions
64 lines (56 loc) · 1.56 KB
/
python_publish_package.yml
File metadata and controls
64 lines (56 loc) · 1.56 KB
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
parameters:
# Artifact feed to pull custom packages from.
- name: pypiAzureArtifactFeed
type: string
# Publish to the public pypi.org
- name: publishToPypiOrg
type: boolean
steps:
# PUBLISH TO AZURE PRIVATE PYPI ###########
# Set up twine
- task: TwineAuthenticate@1
displayName: 'Authenticate Twine'
inputs:
# In this case, name of the feed is 'myTestFeed'
artifactFeed: ${{ parameters.pypiAzureArtifactFeed }}
condition: |
and(
succeeded(),
ne('${{ parameters.pypiAzureArtifactFeed }}', '-'),
eq(variables['Build.SourceBranch'], 'refs/heads/dev')
)
# Release the package on our pypi
- script: python3 setup.py sdist bdist_wheel
displayName: 'Build package'
condition: |
and(
succeeded(),
eq(variables['Build.SourceBranch'], 'refs/heads/dev')
)
- script: |
twine upload \
-r ${{ parameters.pypiAzureArtifactFeed }} \
--config-file $(PYPIRC_PATH) \
dist/*
displayName: 'Upload package to azure pypi'
condition: |
and(
succeeded(),
ne('${{ parameters.pypiAzureArtifactFeed }}', '-'),
eq(variables['Build.SourceBranch'], 'refs/heads/dev')
)
- script: |
twine upload dist/*
env:
TWINE_USERNAME: $(PYPIORG_USER)
TWINE_PASSWORD: $(PYPIORG_PASSWORD)
TWINE_NON_INTERACTIVE: 1
displayName: 'Upload package to pypi.org'
condition: |
and(
succeeded(),
${{ parameters.publishToPypiOrg }},
eq(variables['Build.SourceBranch'], 'refs/heads/dev')
)
# PUBLISH TO PUBLIC PYPI ###########
- template: git_update_master_version.yml