@@ -189,6 +189,7 @@ phases:
189189 variables :
190190 BuildConfig : Release
191191 OfficialBuildId : $(BUILD.BUILDNUMBER)
192+ DotnetVersionKind : $[variables.VERSIONKIND] # If no "VERSIONKIND" variable is set when queuing the publishing task, this defaults to empty string.
192193 DOTNET_CLI_TELEMETRY_OPTOUT : 1
193194 DOTNET_SKIP_FIRST_TIME_EXPERIENCE : 1
194195 DOTNET_MULTILEVEL_LOOKUP : 0
@@ -230,33 +231,42 @@ phases:
230231 sourceFolder : $(Build.SourcesDirectory)/artifacts/pkgassets/PackageAssets
231232 targetFolder : $(Build.SourcesDirectory)/artifacts/pkgassets
232233
233- - script : ./build.cmd -pack -configuration $(BuildConfig)
234+ # Depending on the value of DotNetFinalVersionKind, the name of the package will change.
235+ # For our nightly builds we want it to be empty, and when creating the official nugets, we want it to be "release"
236+ # the value of the version kind is set when queuing the publishing job on AzureDevOps by adding a VERSIONKIND variable
237+ # See more info in: https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/Versioning.md#package-version
238+ - script : ./build.cmd -configuration $(BuildConfig) -pack -ci /p:OfficialBuildId=$(OfficialBuildId) /p:DotNetFinalVersionKind=$(DotnetVersionKind) /p:RestorePackagesPath=$(Build.SourcesDirectory)\packages /p:NUGET_PACKAGES=$(Build.SourcesDirectory)\packages
234239 displayName : Build Packages
235240
236- - script : ./sign.cmd /p:SignNugetPackages=true
241+ - script : ./sign.cmd /p:SignNugetPackages=true /p:RestorePackagesPath=$(Build.SourcesDirectory)\packages /p:NUGET_PACKAGES=$(Build.SourcesDirectory)\packages
237242 displayName : sign packages
238243 continueOnError : false
239244
240245 - task : NuGetAuthenticate@0
241246 inputs :
242247 nuGetServiceConnections : machinelearning-dnceng-public-feed # To allow publishing to a feed of another organization
243248
244- - script : $(Build.SourcesDirectory)\.dotnet\dotnet.exe msbuild build\publish.proj /t:PublishPackages /p:NuGetFeedUrl=$(_AzureDevopsFeedUrl) /p:NuGetApiKey=AzureArtifacts
245- displayName : Publish Packages to AzureDevOps Feed
249+ - task : NuGetCommand@2
250+ displayName : Push packages to AzureDevOps feed
251+ inputs :
252+ command : push
253+ packagesToPush : $(Build.SourcesDirectory)/artifacts/**/*.nupkg;!$(Build.SourcesDirectory)/artifacts/**/*.snupkg
254+ nuGetFeedType : external
255+ publishFeedCredentials : machinelearning-dnceng-public-feed
246256
247257 - task : MSBuild@1
248258 displayName : Publish Symbols to SymWeb Symbol Server
249259 inputs :
250260 solution : build/publish.proj
251- msbuildArguments : /t:PublishSymbolPackages /p:SymbolServerPath=$(_SymwebSymbolServerPath) /p:SymbolServerPAT=$(SymwebSymbolServerPAT)
261+ msbuildArguments : /t:PublishSymbolPackages /p:SymbolServerPath=$(_SymwebSymbolServerPath) /p:SymbolServerPAT=$(SymwebSymbolServerPAT) /p:RestorePackagesPath=$(Build.SourcesDirectory)\packages /p:NUGET_PACKAGES=$(Build.SourcesDirectory)\packages
252262 msbuildVersion : 15.0
253263 continueOnError : true
254264
255265 - task : MSBuild@1
256266 displayName : Publish Symbols to Msdl Symbol Server
257267 inputs :
258268 solution : build/publish.proj
259- msbuildArguments : /t:PublishSymbolPackages /p:SymbolServerPath=$(_MsdlSymbolServerPath) /p:SymbolServerPAT=$(MsdlSymbolServerPAT)
269+ msbuildArguments : /t:PublishSymbolPackages /p:SymbolServerPath=$(_MsdlSymbolServerPath) /p:SymbolServerPAT=$(MsdlSymbolServerPAT) /p:RestorePackagesPath=$(Build.SourcesDirectory)\packages /p:NUGET_PACKAGES=$(Build.SourcesDirectory)\packages
260270 msbuildVersion : 15.0
261271 continueOnError : true
262272
0 commit comments