Skip to content

Commit a3b3523

Browse files
authored
Allow skip publish DocMS or Github IO for each artifact (#13754)
1 parent 30c771e commit a3b3523

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

eng/pipelines/templates/stages/archetype-python-release.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ stages:
4545
RepoId: Azure/azure-sdk-for-python
4646
WorkingDirectory: $(System.DefaultWorkingDirectory)
4747

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

141-
- ${{if ne(artifact.options.skipPublishDocs, 'true')}}:
141+
- ${{if ne(artifact.skipPublishDocGithubIo, 'true')}}:
142142
- deployment: PublishDocs
143143
displayName: "Docs.MS Release"
144144
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'))
@@ -187,7 +187,7 @@ stages:
187187
GHReviewersVariable: 'OwningGHUser'
188188
CIConfigs: $(CIConfigs)
189189

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

244244
- ${{ each artifact in parameters.Artifacts }}:
245-
- pwsh: |
246-
Get-ChildItem $(Pipeline.Workspace)/${{parameters.ArtifactName}}
247-
New-Item -Type Directory -Name ${{artifact.safeName}} -Path $(Pipeline.Workspace)
248-
$underscorePrefix = "${{artifact.name}}"
249-
$dashPrefix = "${{artifact.name}}".Replace("_", "-")
250-
Copy-Item $(Pipeline.Workspace)/${{parameters.ArtifactName}}/$dashPrefix-[0-9]*.[0-9]*.[0-9]*a[0-9]* $(Pipeline.Workspace)/${{artifact.safeName}}
251-
Copy-Item $(Pipeline.Workspace)/${{parameters.ArtifactName}}/$underscorePrefix-[0-9]*.[0-9]*.[0-9]*a[0-9]* $(Pipeline.Workspace)/${{artifact.safeName}}
252-
Get-ChildItem $(Pipeline.Workspace)/${{artifact.safeName}}
245+
- ${{if ne(artifact.skipPublishDevFeed, 'true')}}:
246+
- pwsh: |
247+
Get-ChildItem $(Pipeline.Workspace)/${{parameters.ArtifactName}}
248+
New-Item -Type Directory -Name ${{artifact.safeName}} -Path $(Pipeline.Workspace)
249+
$underscorePrefix = "${{artifact.name}}"
250+
$dashPrefix = "${{artifact.name}}".Replace("_", "-")
251+
Copy-Item $(Pipeline.Workspace)/${{parameters.ArtifactName}}/$dashPrefix-[0-9]*.[0-9]*.[0-9]*a[0-9]* $(Pipeline.Workspace)/${{artifact.safeName}}
252+
Copy-Item $(Pipeline.Workspace)/${{parameters.ArtifactName}}/$underscorePrefix-[0-9]*.[0-9]*.[0-9]*a[0-9]* $(Pipeline.Workspace)/${{artifact.safeName}}
253+
Get-ChildItem $(Pipeline.Workspace)/${{artifact.safeName}}
253254
254-
$fileCount = (Get-ChildItem $(Pipeline.Workspace)/${{artifact.safeName}} | Measure-Object).Count
255-
if ($fileCount -eq 0) {
256-
Write-Host "No alpha packages for ${{artifact.safeName}} to publish."
257-
exit 0
258-
}
255+
$fileCount = (Get-ChildItem $(Pipeline.Workspace)/${{artifact.safeName}} | Measure-Object).Count
256+
if ($fileCount -eq 0) {
257+
Write-Host "No alpha packages for ${{artifact.safeName}} to publish."
258+
exit 0
259+
}
259260
260-
twine upload --repository $(DevFeedName) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/${{artifact.safeName}}/*a*.whl
261-
echo "Uploaded whl to devops feed $(DevFeedName)"
262-
twine upload --repository $(DevFeedName) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/${{artifact.safeName}}/*a*.zip
263-
echo "Uploaded sdist to devops feed $(DevFeedName)"
264-
displayName: 'Publish ${{artifact.name}} alpha package'
261+
twine upload --repository $(DevFeedName) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/${{artifact.safeName}}/*a*.whl
262+
echo "Uploaded whl to devops feed $(DevFeedName)"
263+
twine upload --repository $(DevFeedName) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/${{artifact.safeName}}/*a*.zip
264+
echo "Uploaded sdist to devops feed $(DevFeedName)"
265+
displayName: 'Publish ${{artifact.name}} alpha package'

0 commit comments

Comments
 (0)