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/shared-build-targets-utils/Utils/GitUtils.cs
Normal file
32
build_projects/shared-build-targets-utils/Utils/GitUtils.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Build
|
||||
{
|
||||
public static class GitUtils
|
||||
{
|
||||
public static int GetCommitCount()
|
||||
{
|
||||
return int.Parse(ExecuteGitCommand("rev-list", "--count", "HEAD"));
|
||||
}
|
||||
|
||||
public static string GetCommitHash()
|
||||
{
|
||||
return ExecuteGitCommand("rev-parse", "HEAD");
|
||||
}
|
||||
|
||||
public static string GetBranchName()
|
||||
{
|
||||
return ExecuteGitCommand("rev-parse", "--abbrev-ref", "HEAD");
|
||||
}
|
||||
|
||||
private static string ExecuteGitCommand(params string[] args)
|
||||
{
|
||||
var gitResult = Cmd("git", args)
|
||||
.CaptureStdOut()
|
||||
.Execute();
|
||||
gitResult.EnsureSuccessful();
|
||||
|
||||
return gitResult.StdOut.Trim();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue