21471aa956
We were only building nupkgs on windows, which meant if a non-windows machine was the last leg to finish, we were writing a blank file to the versions repo. Fix #4399
34 lines
1 KiB
C#
34 lines
1 KiB
C#
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
using Microsoft.Build.Framework;
|
|
using Microsoft.Build.Utilities;
|
|
using Microsoft.DotNet.VersionTools.Automation;
|
|
|
|
namespace Microsoft.DotNet.Cli.Build
|
|
{
|
|
public class UpdateVersionsRepo : Task
|
|
{
|
|
[Required]
|
|
public string BranchName { get; set; }
|
|
|
|
[Required]
|
|
public string PackagesDirectory { get; set; }
|
|
|
|
[Required]
|
|
public string GitHubPassword { get; set; }
|
|
|
|
public override bool Execute()
|
|
{
|
|
string versionsRepoPath = $"build-info/dotnet/cli/{BranchName}";
|
|
|
|
GitHubAuth auth = new GitHubAuth(GitHubPassword);
|
|
GitHubVersionsRepoUpdater repoUpdater = new GitHubVersionsRepoUpdater(auth);
|
|
repoUpdater.UpdateBuildInfoAsync(
|
|
new [] { PackagesDirectory },
|
|
versionsRepoPath).Wait();
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|