Skip to content

Commit

Permalink
Allow skip publish DocMS or Github IO for each artifact (#13754)
Browse files Browse the repository at this point in the history
  • Loading branch information
sima-zhu authored Sep 15, 2020
1 parent 30c771e commit a3b3523
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions eng/pipelines/templates/stages/archetype-python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ stages:
RepoId: Azure/azure-sdk-for-python
WorkingDirectory: $(System.DefaultWorkingDirectory)

- ${{if ne(artifact.options.skipPublishPackage, 'true')}}:
- ${{if ne(artifact.skipPublishPackage, 'true')}}:
- deployment: PublishPackage
displayName: "Publish to PyPI"
condition: and(succeeded(), ne(variables['Skip.PublishPackage'], 'true'))
Expand Down Expand Up @@ -103,7 +103,7 @@ stages:
echo "Uploaded sdist to devops feed"
displayName: 'Publish package to feed: ${{parameters.DevFeedName}}'
- ${{if ne(artifact.options.skipPublishDocs, 'true')}}:
- ${{if ne(artifact.skipPublishDocs, 'true')}}:
- deployment: PublishGitHubIODocs
displayName: Publish Docs to GitHubIO Blob Storage
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'))
Expand Down Expand Up @@ -138,7 +138,7 @@ stages:
# we override the regular script path because we have cloned the build tools repo as a separate artifact.
ScriptPath: 'eng/common/scripts/copy-docs-to-blobstorage.ps1'

- ${{if ne(artifact.options.skipPublishDocs, 'true')}}:
- ${{if ne(artifact.skipPublishDocGithubIo, 'true')}}:
- deployment: PublishDocs
displayName: "Docs.MS Release"
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'))
Expand Down Expand Up @@ -187,7 +187,7 @@ stages:
GHReviewersVariable: 'OwningGHUser'
CIConfigs: $(CIConfigs)

- ${{if ne(artifact.options.skipUpdatePackageVersion, 'true')}}:
- ${{if ne(artifact.skipPublishDocGithubIo, 'true')}}:
- deployment: UpdatePackageVersion
displayName: "Update Package Version"
condition: and(succeeded(), ne(variables['Skip.UpdatePackageVersion'], 'true'))
Expand Down Expand Up @@ -242,23 +242,24 @@ stages:
DevFeedName: ${{ parameters.DevFeedName }}

- ${{ each artifact in parameters.Artifacts }}:
- pwsh: |
Get-ChildItem $(Pipeline.Workspace)/${{parameters.ArtifactName}}
New-Item -Type Directory -Name ${{artifact.safeName}} -Path $(Pipeline.Workspace)
$underscorePrefix = "${{artifact.name}}"
$dashPrefix = "${{artifact.name}}".Replace("_", "-")
Copy-Item $(Pipeline.Workspace)/${{parameters.ArtifactName}}/$dashPrefix-[0-9]*.[0-9]*.[0-9]*a[0-9]* $(Pipeline.Workspace)/${{artifact.safeName}}
Copy-Item $(Pipeline.Workspace)/${{parameters.ArtifactName}}/$underscorePrefix-[0-9]*.[0-9]*.[0-9]*a[0-9]* $(Pipeline.Workspace)/${{artifact.safeName}}
Get-ChildItem $(Pipeline.Workspace)/${{artifact.safeName}}
- ${{if ne(artifact.skipPublishDevFeed, 'true')}}:
- pwsh: |
Get-ChildItem $(Pipeline.Workspace)/${{parameters.ArtifactName}}
New-Item -Type Directory -Name ${{artifact.safeName}} -Path $(Pipeline.Workspace)
$underscorePrefix = "${{artifact.name}}"
$dashPrefix = "${{artifact.name}}".Replace("_", "-")
Copy-Item $(Pipeline.Workspace)/${{parameters.ArtifactName}}/$dashPrefix-[0-9]*.[0-9]*.[0-9]*a[0-9]* $(Pipeline.Workspace)/${{artifact.safeName}}
Copy-Item $(Pipeline.Workspace)/${{parameters.ArtifactName}}/$underscorePrefix-[0-9]*.[0-9]*.[0-9]*a[0-9]* $(Pipeline.Workspace)/${{artifact.safeName}}
Get-ChildItem $(Pipeline.Workspace)/${{artifact.safeName}}
$fileCount = (Get-ChildItem $(Pipeline.Workspace)/${{artifact.safeName}} | Measure-Object).Count
if ($fileCount -eq 0) {
Write-Host "No alpha packages for ${{artifact.safeName}} to publish."
exit 0
}
$fileCount = (Get-ChildItem $(Pipeline.Workspace)/${{artifact.safeName}} | Measure-Object).Count
if ($fileCount -eq 0) {
Write-Host "No alpha packages for ${{artifact.safeName}} to publish."
exit 0
}
twine upload --repository $(DevFeedName) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/${{artifact.safeName}}/*a*.whl
echo "Uploaded whl to devops feed $(DevFeedName)"
twine upload --repository $(DevFeedName) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/${{artifact.safeName}}/*a*.zip
echo "Uploaded sdist to devops feed $(DevFeedName)"
displayName: 'Publish ${{artifact.name}} alpha package'
twine upload --repository $(DevFeedName) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/${{artifact.safeName}}/*a*.whl
echo "Uploaded whl to devops feed $(DevFeedName)"
twine upload --repository $(DevFeedName) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/${{artifact.safeName}}/*a*.zip
echo "Uploaded sdist to devops feed $(DevFeedName)"
displayName: 'Publish ${{artifact.name}} alpha package'

0 comments on commit a3b3523

Please sign in to comment.