2016-10-12 19:25:06 +00:00
|
|
|
|
// 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;
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli.Build
|
|
|
|
|
{
|
|
|
|
|
public class UpdateVersionsRepo : Task
|
|
|
|
|
{
|
|
|
|
|
[Required]
|
|
|
|
|
public string BranchName { get; set; }
|
2017-07-26 16:55:10 +00:00
|
|
|
|
public string GitHubPassword { get; set; }
|
2016-10-12 19:25:06 +00:00
|
|
|
|
|
|
|
|
|
public override bool Execute()
|
|
|
|
|
{
|
2017-07-26 16:55:10 +00:00
|
|
|
|
string githubAuthToken = GitHubPassword;
|
2016-10-12 19:25:06 +00:00
|
|
|
|
string nupkgFilePath = Dirs.Packages;
|
|
|
|
|
string branchName = BranchName;
|
|
|
|
|
string versionsRepoPath = $"build-info/dotnet/cli/{branchName}/Latest";
|
|
|
|
|
|
|
|
|
|
VersionRepoUpdater repoUpdater = new VersionRepoUpdater(githubAuthToken);
|
|
|
|
|
repoUpdater.UpdatePublishedVersions(nupkgFilePath, versionsRepoPath).Wait();
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|