Skip to content

Commit 28ea606

Browse files
authored
ensure that the integration publish stage only triggers on internal builds (#35075)
1 parent ede0a28 commit 28ea606

File tree

1 file changed

+78
-78
lines changed

1 file changed

+78
-78
lines changed

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

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -258,83 +258,83 @@ stages:
258258
ArtifactName: ${{ parameters.ArtifactName }}
259259
Artifact: ${{ artifact }}
260260

261-
262-
- stage: Integration
263-
dependsOn: ${{parameters.DependsOn}}
264-
condition: succeededOrFailed('${{parameters.DependsOn}}')
265-
jobs:
266-
- job: PublishPackages
267-
displayName: "Publish package to daily feed"
268-
condition: or(eq(variables['SetDevVersion'], 'true'), and(eq(variables['Build.Reason'],'Schedule'), eq(variables['System.TeamProject'], 'internal')))
269-
pool:
270-
image: azsdk-pool-mms-ubuntu-2004-1espt
271-
name: azsdk-pool-mms-ubuntu-2004-general
272-
os: linux
273-
steps:
274-
- checkout: none
275-
- download: current
276-
artifact: ${{parameters.ArtifactName}}
277-
timeoutInMinutes: 5
278-
- task: UsePythonVersion@0
279-
- script: |
280-
set -e
281-
python -m pip install twine
282-
displayName: Install Twine
283-
284-
- template: ../steps/auth-dev-feed.yml
285-
parameters:
286-
DevFeedName: ${{ parameters.DevFeedName }}
287-
288-
- ${{ each artifact in parameters.Artifacts }}:
289-
- ${{if ne(artifact.skipPublishDevFeed, 'true')}}:
290-
291-
- pwsh: |
292-
$fileCount = (Get-ChildItem $(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{artifact.name}} | ? {$_.Name -match "-[0-9]*.[0-9]*.[0-9]*a[0-9]*" } | Measure-Object).Count
293-
294-
if ($fileCount -eq 0) {
295-
Write-Host "No alpha packages for ${{artifact.name}} to publish."
296-
exit 0
297-
}
298-
299-
twine upload --repository $(DevFeedName) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{artifact.name}}/*-*a*.whl
300-
echo "Uploaded whl to devops feed $(DevFeedName)"
301-
twine upload --repository $(DevFeedName) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{artifact.name}}/*-*a*.tar.gz
302-
echo "Uploaded sdist to devops feed $(DevFeedName)"
303-
displayName: 'Publish ${{artifact.name}} alpha package'
304-
305-
- job: PublishDocsToNightlyBranch
306-
dependsOn: PublishPackages
307-
condition: or(eq(variables['SetDevVersion'], 'true'), and(eq(variables['Build.Reason'],'Schedule'), eq(variables['System.TeamProject'], 'internal')))
308-
pool:
309-
image: azsdk-pool-mms-ubuntu-2004-1espt
310-
name: azsdk-pool-mms-ubuntu-2004-general
311-
os: linux
312-
steps:
313-
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
314-
parameters:
315-
Paths:
316-
- sdk/**/*.md
317-
- .github/CODEOWNERS
261+
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
262+
- stage: Integration
263+
dependsOn: ${{parameters.DependsOn}}
264+
condition: succeededOrFailed('${{parameters.DependsOn}}')
265+
jobs:
266+
- job: PublishPackages
267+
displayName: "Publish package to daily feed"
268+
condition: or(eq(variables['SetDevVersion'], 'true'), and(eq(variables['Build.Reason'],'Schedule'), eq(variables['System.TeamProject'], 'internal')))
269+
pool:
270+
image: azsdk-pool-mms-ubuntu-2004-1espt
271+
name: azsdk-pool-mms-ubuntu-2004-general
272+
os: linux
273+
steps:
274+
- checkout: none
318275
- download: current
319-
- pwsh: |
320-
Get-ChildItem -Recurse $(Pipeline.Workspace)/${{parameters.ArtifactName}}/
321-
displayName: Show visible artifacts
322-
323-
- template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml
276+
artifact: ${{parameters.ArtifactName}}
277+
timeoutInMinutes: 5
278+
- task: UsePythonVersion@0
279+
- script: |
280+
set -e
281+
python -m pip install twine
282+
displayName: Install Twine
283+
284+
- template: ../steps/auth-dev-feed.yml
324285
parameters:
325-
PackageInfoLocations:
326-
- ${{ each artifact in parameters.Artifacts }}:
327-
- ${{if ne(artifact.skipPublishDocMs, 'true')}}:
328-
- $(Pipeline.Workspace)/${{parameters.ArtifactName}}/PackageInfo/${{artifact.name}}.json
329-
WorkingDirectory: $(System.DefaultWorkingDirectory)
330-
TargetDocRepoOwner: ${{parameters.TargetDocRepoOwner}}
331-
TargetDocRepoName: ${{parameters.TargetDocRepoName}}
332-
Language: 'python'
333-
DailyDocsBuild: true
334-
SparseCheckoutPaths:
335-
- docs-ref-services/
336-
- metadata/
337-
PackageSourceOverride: ${{parameters.PackageSourceOverride}}
338-
DocValidationImageId: ${{parameters.DocValidationImageId}}
339-
340-
- template: /eng/common/pipelines/templates/steps/docsms-ensure-validation.yml
286+
DevFeedName: ${{ parameters.DevFeedName }}
287+
288+
- ${{ each artifact in parameters.Artifacts }}:
289+
- ${{if ne(artifact.skipPublishDevFeed, 'true')}}:
290+
291+
- pwsh: |
292+
$fileCount = (Get-ChildItem $(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{artifact.name}} | ? {$_.Name -match "-[0-9]*.[0-9]*.[0-9]*a[0-9]*" } | Measure-Object).Count
293+
294+
if ($fileCount -eq 0) {
295+
Write-Host "No alpha packages for ${{artifact.name}} to publish."
296+
exit 0
297+
}
298+
299+
twine upload --repository $(DevFeedName) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{artifact.name}}/*-*a*.whl
300+
echo "Uploaded whl to devops feed $(DevFeedName)"
301+
twine upload --repository $(DevFeedName) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{artifact.name}}/*-*a*.tar.gz
302+
echo "Uploaded sdist to devops feed $(DevFeedName)"
303+
displayName: 'Publish ${{artifact.name}} alpha package'
304+
305+
- job: PublishDocsToNightlyBranch
306+
dependsOn: PublishPackages
307+
condition: or(eq(variables['SetDevVersion'], 'true'), and(eq(variables['Build.Reason'],'Schedule'), eq(variables['System.TeamProject'], 'internal')))
308+
pool:
309+
image: azsdk-pool-mms-ubuntu-2004-1espt
310+
name: azsdk-pool-mms-ubuntu-2004-general
311+
os: linux
312+
steps:
313+
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
314+
parameters:
315+
Paths:
316+
- sdk/**/*.md
317+
- .github/CODEOWNERS
318+
- download: current
319+
- pwsh: |
320+
Get-ChildItem -Recurse $(Pipeline.Workspace)/${{parameters.ArtifactName}}/
321+
displayName: Show visible artifacts
322+
323+
- template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml
324+
parameters:
325+
PackageInfoLocations:
326+
- ${{ each artifact in parameters.Artifacts }}:
327+
- ${{if ne(artifact.skipPublishDocMs, 'true')}}:
328+
- $(Pipeline.Workspace)/${{parameters.ArtifactName}}/PackageInfo/${{artifact.name}}.json
329+
WorkingDirectory: $(System.DefaultWorkingDirectory)
330+
TargetDocRepoOwner: ${{parameters.TargetDocRepoOwner}}
331+
TargetDocRepoName: ${{parameters.TargetDocRepoName}}
332+
Language: 'python'
333+
DailyDocsBuild: true
334+
SparseCheckoutPaths:
335+
- docs-ref-services/
336+
- metadata/
337+
PackageSourceOverride: ${{parameters.PackageSourceOverride}}
338+
DocValidationImageId: ${{parameters.DocValidationImageId}}
339+
340+
- template: /eng/common/pipelines/templates/steps/docsms-ensure-validation.yml

0 commit comments

Comments
 (0)