Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 22 additions & 26 deletions .Pipelines/pipeline-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pr: none
variables:
CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)]
system.debug: ${{ parameters.debug }}
WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest' # https://aka.ms/obpipelines/containers

resources:
repositories:
Expand Down Expand Up @@ -64,6 +65,7 @@ extends:
tsaEnabled: true
featureFlags:
EnableCDPxPAT: false
WindowsHostVersion: '1ESWindows2022'

stages:

Expand All @@ -82,34 +84,26 @@ extends:
condition: eq(dependencies.E2ETests.result, 'Succeeded')
jobs:
- job: BuildDist
displayName: 'Build sdist + wheel (Python 3.12)'
displayName: 'Build sdist + wheel'
pool:
type: linux
isCustom: true
vmImage: 'ubuntu-22.04'
type: windows
variables:
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.12'
displayName: 'Use Python 3.12'
- script: python --version
displayName: 'Check Python version'

- script: |
python -m pip install --upgrade pip build twine
displayName: 'Install build toolchain'

- script: |
python -m build
- script: python setup.py sdist bdist_wheel
displayName: 'Build sdist and wheel'
Comment on lines +93 to 97

- script: |
python -m twine check dist/*
displayName: 'Verify distribution (twine check)'

- script: |
cp -r dist/* $(ob_outputDirectory)/
- task: CopyFiles@2
displayName: 'Copy dist to output directory'
inputs:
SourceFolder: '$(Build.SourcesDirectory)\dist'
Contents: |
*.whl
*.tar.gz
TargetFolder: '$(ob_outputDirectory)'

# ========================================================================
# Stage 5a - Publish to test.pypi.org (Preview / RC)
Expand All @@ -135,8 +129,9 @@ extends:
- task: DownloadPipelineArtifact@2
displayName: 'Download build artifact'
inputs:
artifactName: drop_Build_BuildDist
targetPath: $(Pipeline.Workspace)/python-dist
buildType: 'current'
artifactName: 'drop_Build_BuildDist'
targetPath: $(Pipeline.Workspace)\python-dist

Comment on lines 129 to 135
- task: UsePythonVersion@0
inputs:
Expand Down Expand Up @@ -211,8 +206,9 @@ extends:
- task: DownloadPipelineArtifact@2
displayName: 'Download python-dist artifact'
inputs:
artifactName: drop_Build_BuildDist
targetPath: $(Pipeline.Workspace)/python-dist
buildType: 'current'
artifactName: 'drop_Build_BuildDist'
targetPath: $(Pipeline.Workspace)\python-dist

- task: EsrpRelease@12
displayName: 'Publish to PyPI via ESRP'
Expand All @@ -225,9 +221,9 @@ extends:
intent: 'PackageDistribution'
contenttype: 'PyPi'
contentsource: 'Folder'
folderlocation: '$(Pipeline.Workspace)/python-dist'
folderlocation: '$(Pipeline.Workspace)\python-dist'
waitforreleasecompletion: true
owners: 'ryauld@microsoft.com,avdunn@microsoft.com'
owners: 'avdunn@microsoft.com,bogavril@microsoft.com'
approvers: 'avdunn@microsoft.com,bogavril@microsoft.com'
serviceendpointurl: 'https://api.esrp.microsoft.com'
mainpublisher: 'ESRPRELPACMAN'
Expand Down
Loading