Skip to content

[CI] Add Publish Stage #362

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

Merged
merged 11 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
22 changes: 22 additions & 0 deletions eng/pipelines/official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,25 @@ extends:
workloadDropNames: ${{ parameters.workloadDropNames }}
primaryVsInsertionBranches: ${{ parameters.primaryVsInsertionBranches }}
secondaryVsInsertionBranches: ${{ parameters.secondaryVsInsertionBranches }}
- stage: Publish
displayName: Publish
dependsOn: Build
condition: succeeded()
jobs:
- deployment: Publish
environment: 'DotNet-SDK-Workloads'
pool:
name: $(DncEngInternalBuildPool)
image: 1es-windows-2022
os: windows
templateContext:
type: releaseJob
isProduction: true
strategy:
runOnce:
deploy:
steps:
- 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
22 changes: 22 additions & 0 deletions eng/pipelines/templates/steps/workload-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
parameters:
- name: publishToFeed
displayName: Publish to feed
type: boolean
default: false
- name: feedForPublishing
displayName: Feed for publishing
type: string
default: public/dotnet10-workloads

steps:
- task: 1ES.PublishNuget@1
condition: ${{ eq(parameters.publishToFeed, true) }}
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