dotnet-installer/build_projects/dotnet-cli-build/UpdateVersionsRepo.cs

35 lines
1 KiB
C#
Raw Normal View History

// 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;
}
}
}