Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Add Publish Stage #362

Merged
merged 11 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions eng/pipelines/official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,38 @@ extends:
- template: /eng/pipelines/templates/jobs/workload-build.yml@self
parameters:
stabilizePackageVersion: ${{ parameters.stabilizePackageVersion }}
publishToFeed: ${{ parameters.publishToFeed }}
feedForPublishing: ${{ parameters.feedForPublishing }}
createVSInsertion: ${{ parameters.createVSInsertion }}
usePreComponentsForVSInsertion: ${{ parameters.usePreComponentsForVSInsertion }}
includeNonShippingWorkloads: ${{ parameters.includeNonShippingWorkloads }}
vsTopicBranch: ${{ parameters.vsTopicBranch }}
workloadDropNames: ${{ parameters.workloadDropNames }}
primaryVsInsertionBranches: ${{ parameters.primaryVsInsertionBranches }}
secondaryVsInsertionBranches: ${{ parameters.secondaryVsInsertionBranches }}
- stage: Publish
displayName: Publish
dependsOn: Build
condition: succeeded()
jobs:
- deployment: PublishFeed
displayName: Publish to feed
environment: DotNet-SDK-Workloads
pool:
name: $(DncEngInternalBuildPool)
image: 1es-windows-2022
os: windows
templateContext:
type: releaseJob
isProduction: true
strategy:
runOnce:
deploy:
steps:
- task: 1ES.DownloadPipelineArtifact@1
displayName: 🟣 Import PackageArtifacts from Previous Stage
inputs:
artifactName: PackageArtifacts
targetPath: $(Pipeline.Workspace)/PackageArtifacts
- template: /eng/pipelines/templates/steps/workload-publish.yml@self
parameters:
publishToFeed: ${{ parameters.publishToFeed }}
feedForPublishing: ${{ parameters.feedForPublishing }}
12 changes: 0 additions & 12 deletions eng/pipelines/templates/jobs/workload-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,6 @@ jobs:
/p:StabilizePackageVersion=${{ parameters.stabilizePackageVersion }}
displayName: 🟣 Build solution

- ${{ if eq(parameters.publishToFeed, true) }}:
- task: 1ES.PublishNuget@1
displayName: 🟣 Publish NuGet package
inputs:
useDotNetTask: true
packagesToPush: $(Build.SourcesDirectory)/artifacts/packages/**/*.nupkg
packageParentPath: $(Build.SourcesDirectory)/artifacts/packages
publishVstsFeed: ${{ parameters.feedForPublishing }}
nuGetFeedType: internal
allowPackageConflicts: false
publishPackageMetadata: true

- ${{ if eq(parameters.createVSInsertion, true) }}:
# The variables comprised of workloadShortName and workloadType are set during create-workload-drops.ps1 in Microsoft.NET.Workloads.Vsman.csproj.
- ${{ each workloadShortName in parameters.workloadDropNames }}:
Expand Down
16 changes: 16 additions & 0 deletions eng/pipelines/templates/steps/workload-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
parameters:
publishToFeed: false
feedForPublishing: ''

steps:
- task: 1ES.PublishNuget@1
condition: ${{ eq(parameters.publishToFeed, true) }}
displayName: 🟣 Publish package to AzDO
inputs:
useDotNetTask: true
packagesToPush: $(Pipeline.Workspace)/PackageArtifacts/*.nupkg
packageParentPath: $(Pipeline.Workspace)/PackageArtifacts
publishVstsFeed: ${{ parameters.feedForPublishing }}
nuGetFeedType: internal
allowPackageConflicts: false
publishPackageMetadata: true