From 4309f3d85f2d737555dea3cc3aafb3152af6aed6 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Fri, 11 Sep 2020 16:40:15 -0700 Subject: [PATCH 1/3] Allow skip publish DocMS or Github IO for each artifact --- .../templates/stages/archetype-python-release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/templates/stages/archetype-python-release.yml b/eng/pipelines/templates/stages/archetype-python-release.yml index 33849353c855..441343ace6e7 100644 --- a/eng/pipelines/templates/stages/archetype-python-release.yml +++ b/eng/pipelines/templates/stages/archetype-python-release.yml @@ -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')) @@ -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')) @@ -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')) @@ -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')) From f3411edd9563d599fb42ca4b33f514816000a4ad Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Mon, 14 Sep 2020 12:14:34 -0700 Subject: [PATCH 2/3] Added artifact level skip publish dev feed --- .../stages/archetype-python-release.yml | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/eng/pipelines/templates/stages/archetype-python-release.yml b/eng/pipelines/templates/stages/archetype-python-release.yml index 441343ace6e7..73addb9ab980 100644 --- a/eng/pipelines/templates/stages/archetype-python-release.yml +++ b/eng/pipelines/templates/stages/archetype-python-release.yml @@ -255,23 +255,24 @@ stages: artifactFeeds: $(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' \ No newline at end of file + 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' \ No newline at end of file From 1319f003a19b631f5ebe59773fc98beb619ddce5 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Mon, 14 Sep 2020 13:37:01 -0700 Subject: [PATCH 3/3] Fixed the wrong indentation. --- eng/pipelines/templates/stages/archetype-python-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/stages/archetype-python-release.yml b/eng/pipelines/templates/stages/archetype-python-release.yml index 73addb9ab980..931b4c690bef 100644 --- a/eng/pipelines/templates/stages/archetype-python-release.yml +++ b/eng/pipelines/templates/stages/archetype-python-release.yml @@ -256,7 +256,7 @@ stages: - ${{ each artifact in parameters.Artifacts }}: - ${{if ne(artifact.skipPublishDevFeed, 'true')}}: - - pwsh: | + - pwsh: | Get-ChildItem $(Pipeline.Workspace)/${{parameters.ArtifactName}} New-Item -Type Directory -Name ${{artifact.safeName}} -Path $(Pipeline.Workspace) $underscorePrefix = "${{artifact.name}}"