diff options
Diffstat (limited to 'azure-pipelines/template/publish_pypi.yml')
-rw-r--r-- | azure-pipelines/template/publish_pypi.yml | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/azure-pipelines/template/publish_pypi.yml b/azure-pipelines/template/publish_pypi.yml new file mode 100644 index 0000000..1f29e1b --- /dev/null +++ b/azure-pipelines/template/publish_pypi.yml @@ -0,0 +1,43 @@ +parameters: + - name: publishPyPI + displayName: 🚀 Publish To PyPI + type: string + +jobs: + - job: PublishPkg + displayName: Publish Packages + + pool: + vmImage: windows-latest + + steps: + - task: DownloadPipelineArtifact@2 + displayName: "Download Pipeline Artifact" + inputs: + artifactName: dist + targetPath: "$(Build.SourcesDirectory)/dist" + + - task: UsePythonVersion@0 + displayName: "Use Python 3.7" + inputs: + versionSpec: 3.7 + + - script: python -m pip install -U pip + displayName: Upgrade Pip + + - script: python -m pip install twine + displayName: Install Twine + + - ${{ if eq(parameters.publishPyPI, 'Test') }}: + - script: python -m twine upload -r testpypi dist/* + displayName: Publish to Test PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: $(test_pypi_token) + + - ${{ if eq(parameters.publishPyPI, 'Real') }}: + - script: python -m twine upload dist/* + displayName: Publish to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: $(real_pypi_token) |