@@ -111,3 +111,52 @@ extends:
111111 displayName : Build NuGet
112112 jobs :
113113 - template : .pipelines/templates/build-nuget.yml@self
114+
115+ - stage : Release_NuGet
116+ displayName : Release NuGet
117+ dependsOn : [Build_Nuget]
118+ jobs :
119+ - job : NuGetPublish
120+ displayName : Publish to NuGet
121+ condition : succeeded()
122+ pool :
123+ type : release
124+ os : windows
125+ templateContext :
126+ inputs :
127+ - input : pipelineArtifact
128+ artifactName : drop_Build_Nuget_Build_Nuget
129+ variables :
130+ - template : ./variable/release-shared.yml@self
131+ parameters :
132+ VERSION : $[ stageDependencies.Build_Nuget.Build_Nuget.outputs['PackageVersion'] ]
133+
134+ steps :
135+ - task : PowerShell@2
136+ inputs :
137+ targetType : inline
138+ script : |
139+ Write-Verbose -Verbose "Version: $(Version)"
140+ Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
141+ displayName : ' Capture Environment Variables'
142+
143+ - task : PowerShell@2
144+ inputs :
145+ targetType : inline
146+ script : |
147+ $null = New-Item -ItemType Directory -Path "$(Pipeline.Workspace)/release"
148+ Copy-Item "$(Pipeline.Workspace)/drop_Build_Nuget_Build_Nuget/*.nupkg" -Destination "$(Pipeline.Workspace)/release" -Force -Verbose
149+ Write-Verbose -Verbose "The .nupkgs below will be pushed:"
150+ Get-ChildItem "$(Pipeline.Workspace)/release" -recurse
151+ displayName : Download and capture nupkgs
152+ condition : and(eq('${{ parameters.OfficialBuild }}', 'true'), succeeded())
153+
154+ # - task: NuGetCommand@2
155+ # displayName: 'NuGet push'
156+ # condition: and(eq('${{ parameters.OfficialBuild }}', 'true'), succeeded())
157+ # inputs:
158+ # command: push
159+ # packagesToPush: '$(Pipeline.Workspace)/release/*.nupkg'
160+ # nuGetFeedType: external
161+ # publishFeedCredentials: PowerShellNuGetOrgPush
162+
0 commit comments