@@ -21,7 +21,19 @@ parameters:
21
21
- name : cache_nuget
22
22
displayName : Cache NuGet packages
23
23
type : boolean
24
- default : false # As long as we're overwriting versions on MyGet, we can't cache NuGet packages
24
+ default : false # As long as we're overwriting versions on MyGet, we can't cache NuGet packages by default
25
+ - name : release_myget
26
+ displayName : Release to pre-release/nightly MyGet feed
27
+ type : boolean
28
+ default : false
29
+ - name : release_myget_nightly
30
+ displayName : Release to nightly MyGet feed (instead of pre-release)
31
+ type : boolean
32
+ default : false
33
+ - name : release_nuget
34
+ displayName : Release to public NuGet feed
35
+ type : boolean
36
+ default : false
25
37
26
38
variables :
27
39
solution : Umbraco.Deploy.Contrib.sln
@@ -119,3 +131,50 @@ stages:
119
131
searchFolder : $(Build.ArtifactStagingDirectory)/tests
120
132
testRunTitle : Unit Tests
121
133
configuration : $(buildConfiguration)
134
+
135
+ - stage : ReleaseMyGet
136
+ displayName : Release to pre-release/nightly MyGet feed
137
+ dependsOn : Test
138
+ condition : and(succeeded(), or(eq(dependencies.Build.outputs['Build.build.NBGV_PublicRelease'], 'True'), ${{ parameters.release_myget }}))
139
+ jobs :
140
+ - job :
141
+ displayName : Push to MyGet feed
142
+ steps :
143
+ - checkout : none
144
+ - task : DownloadPipelineArtifact@2
145
+ displayName : Download nupkg
146
+ inputs :
147
+ artifact : nupkg
148
+ path : $(Build.ArtifactStagingDirectory)/nupkg
149
+ - task : NuGetCommand@2
150
+ displayName : NuGet push
151
+ inputs :
152
+ command : ' push'
153
+ packagesToPush : $(Build.ArtifactStagingDirectory)/nupkg/*.nupkg
154
+ nuGetFeedType : ' external'
155
+ ${{ if eq(parameters.release_myget_nightly, true) }} :
156
+ publishFeedCredentials : ' MyGet - Nightly'
157
+ ${{ else }} :
158
+ publishFeedCredentials : ' MyGet - Pre-releases'
159
+
160
+ - stage : ReleaseNuGet
161
+ displayName : Release to public NuGet feed
162
+ dependsOn : ReleaseMyGet
163
+ condition : and(succeeded(), or(eq(dependencies.Build.outputs['Build.build.NBGV_PublicRelease'], 'True'), ${{ parameters.release_nuget }}))
164
+ jobs :
165
+ - job :
166
+ displayName : Push to MyGet feed
167
+ steps :
168
+ - checkout : none
169
+ - task : DownloadPipelineArtifact@2
170
+ displayName : Download nupkg
171
+ inputs :
172
+ artifact : nupkg
173
+ path : $(Build.ArtifactStagingDirectory)/nupkg
174
+ - task : NuGetCommand@2
175
+ displayName : NuGet push
176
+ inputs :
177
+ command : ' push'
178
+ packagesToPush : $(Build.ArtifactStagingDirectory)/nupkg/*.nupkg
179
+ nuGetFeedType : ' external'
180
+ publishFeedCredentials : ' NuGet'
0 commit comments