Move PullNupkgFilesFromBlob into FinalizeBuild.
Also, update dotnet/versions for the DotNetHost and NetCore.App packages. Fix #3031
This commit is contained in:
parent
54ab5b8385
commit
78e34c6eb7
6 changed files with 87 additions and 137 deletions
32
build_projects/dotnet-cli-build/NuGetUtil.cs
Normal file
32
build_projects/dotnet-cli-build/NuGetUtil.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System.IO;
|
||||
using System.Reflection;
|
||||
using Microsoft.DotNet.Cli.Build.Framework;
|
||||
using NugetProgram = NuGet.CommandLine.XPlat.Program;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Build
|
||||
{
|
||||
public static class NuGetUtil
|
||||
{
|
||||
public static void PushPackages(string packagesPath, string destinationUrl, string apiKey)
|
||||
{
|
||||
int result = RunNuGetCommand(
|
||||
"push",
|
||||
"-s", destinationUrl,
|
||||
"-k", apiKey,
|
||||
Path.Combine(packagesPath, "*.nupkg"));
|
||||
|
||||
if (result != 0)
|
||||
{
|
||||
throw new BuildFailureException($"NuGet Push failed with exit code '{result}'.");
|
||||
}
|
||||
}
|
||||
|
||||
private static int RunNuGetCommand(params string[] nugetArgs)
|
||||
{
|
||||
var nugetAssembly = typeof(NugetProgram).GetTypeInfo().Assembly;
|
||||
var mainMethod = nugetAssembly.EntryPoint;
|
||||
return (int)mainMethod.Invoke(null, new object[] { nugetArgs });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue