Skip to content

Commit a921e09

Browse files
authored
[CI] Add Publish Stage (#362)
1 parent e4900e7 commit a921e09

File tree

3 files changed

+44
-14
lines changed

3 files changed

+44
-14
lines changed

eng/pipelines/official.yml

+28-2
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,38 @@ extends:
107107
- template: /eng/pipelines/templates/jobs/workload-build.yml@self
108108
parameters:
109109
stabilizePackageVersion: ${{ parameters.stabilizePackageVersion }}
110-
publishToFeed: ${{ parameters.publishToFeed }}
111-
feedForPublishing: ${{ parameters.feedForPublishing }}
112110
createVSInsertion: ${{ parameters.createVSInsertion }}
113111
usePreComponentsForVSInsertion: ${{ parameters.usePreComponentsForVSInsertion }}
114112
includeNonShippingWorkloads: ${{ parameters.includeNonShippingWorkloads }}
115113
vsTopicBranch: ${{ parameters.vsTopicBranch }}
116114
workloadDropNames: ${{ parameters.workloadDropNames }}
117115
primaryVsInsertionBranches: ${{ parameters.primaryVsInsertionBranches }}
118116
secondaryVsInsertionBranches: ${{ parameters.secondaryVsInsertionBranches }}
117+
- stage: Publish
118+
displayName: Publish
119+
dependsOn: Build
120+
condition: succeeded()
121+
jobs:
122+
- deployment: PublishFeed
123+
displayName: Publish to feed
124+
environment: DotNet-SDK-Workloads
125+
pool:
126+
name: $(DncEngInternalBuildPool)
127+
image: 1es-windows-2022
128+
os: windows
129+
templateContext:
130+
type: releaseJob
131+
isProduction: true
132+
strategy:
133+
runOnce:
134+
deploy:
135+
steps:
136+
- task: 1ES.DownloadPipelineArtifact@1
137+
displayName: 🟣 Import PackageArtifacts from Previous Stage
138+
inputs:
139+
artifactName: PackageArtifacts
140+
targetPath: $(Pipeline.Workspace)/PackageArtifacts
141+
- template: /eng/pipelines/templates/steps/workload-publish.yml@self
142+
parameters:
143+
publishToFeed: ${{ parameters.publishToFeed }}
144+
feedForPublishing: ${{ parameters.feedForPublishing }}

eng/pipelines/templates/jobs/workload-build.yml

-12
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,6 @@ jobs:
6262
/p:StabilizePackageVersion=${{ parameters.stabilizePackageVersion }}
6363
displayName: 🟣 Build solution
6464
65-
- ${{ if eq(parameters.publishToFeed, true) }}:
66-
- task: 1ES.PublishNuget@1
67-
displayName: 🟣 Publish NuGet package
68-
inputs:
69-
useDotNetTask: true
70-
packagesToPush: $(Build.SourcesDirectory)/artifacts/packages/**/*.nupkg
71-
packageParentPath: $(Build.SourcesDirectory)/artifacts/packages
72-
publishVstsFeed: ${{ parameters.feedForPublishing }}
73-
nuGetFeedType: internal
74-
allowPackageConflicts: false
75-
publishPackageMetadata: true
76-
7765
- ${{ if eq(parameters.createVSInsertion, true) }}:
7866
# The variables comprised of workloadShortName and workloadType are set during create-workload-drops.ps1 in Microsoft.NET.Workloads.Vsman.csproj.
7967
- ${{ each workloadShortName in parameters.workloadDropNames }}:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
parameters:
2+
publishToFeed: false
3+
feedForPublishing: ''
4+
5+
steps:
6+
- task: 1ES.PublishNuget@1
7+
condition: ${{ eq(parameters.publishToFeed, true) }}
8+
displayName: 🟣 Publish package to AzDO
9+
inputs:
10+
useDotNetTask: true
11+
packagesToPush: $(Pipeline.Workspace)/PackageArtifacts/*.nupkg
12+
packageParentPath: $(Pipeline.Workspace)/PackageArtifacts
13+
publishVstsFeed: ${{ parameters.feedForPublishing }}
14+
nuGetFeedType: internal
15+
allowPackageConflicts: false
16+
publishPackageMetadata: true

0 commit comments

Comments
 (0)