diff --git a/branchinfo.txt b/branchinfo.txt index 714dc774c..ad298977a 100644 --- a/branchinfo.txt +++ b/branchinfo.txt @@ -6,3 +6,4 @@ MINOR_VERSION=0 PATCH_VERSION=0 RELEASE_SUFFIX=preview2 CHANNEL=preview +BRANCH_NAME=rel/1.0.0-preview2 diff --git a/build_projects/dotnet-cli-build/PrepareTargets.cs b/build_projects/dotnet-cli-build/PrepareTargets.cs index 4353addbf..566eabc73 100644 --- a/build_projects/dotnet-cli-build/PrepareTargets.cs +++ b/build_projects/dotnet-cli-build/PrepareTargets.cs @@ -75,9 +75,9 @@ namespace Microsoft.DotNet.Cli.Build ReleaseSuffix = branchInfo["RELEASE_SUFFIX"], CommitCount = commitCount }; - - c.BuildContext["BuildVersion"] = buildVersion; + + c.BuildContext["BranchName"] = branchInfo["BRANCH_NAME"]; c.BuildContext["CommitHash"] = commitHash; c.Info($"Building Version: {buildVersion.SimpleVersion} (NuGet Packages: {buildVersion.NuGetVersion})"); diff --git a/build_projects/dotnet-cli-build/PublishTargets.cs b/build_projects/dotnet-cli-build/PublishTargets.cs index ed0b07264..bd51c3469 100644 --- a/build_projects/dotnet-cli-build/PublishTargets.cs +++ b/build_projects/dotnet-cli-build/PublishTargets.cs @@ -15,8 +15,6 @@ namespace Microsoft.DotNet.Cli.Build private static string Channel { get; set; } - private static string CliVersion { get; set; } - private static string CliNuGetVersion { get; set; } private static string SharedFrameworkNugetVersion { get; set; } @@ -27,7 +25,6 @@ namespace Microsoft.DotNet.Cli.Build AzurePublisherTool = new AzurePublisher(); DebRepoPublisherTool = new DebRepoPublisher(Dirs.Packages); - CliVersion = c.BuildContext.Get("BuildVersion").SimpleVersion; CliNuGetVersion = c.BuildContext.Get("BuildVersion").NuGetVersion; SharedFrameworkNugetVersion = CliDependencyVersions.SharedFrameworkVersion; Channel = c.BuildContext.Get("Channel"); @@ -107,6 +104,8 @@ namespace Microsoft.DotNet.Cli.Build { AzurePublisherTool.PublishStringToBlob($"{Channel}/dnvm/latest.{version}", cliVersion); } + + UpdateVersionsRepo(c); } finally { @@ -288,17 +287,15 @@ namespace Microsoft.DotNet.Cli.Build return c.Success(); } - [Target(nameof(PrepareTargets.Init))] - public static BuildTargetResult UpdateVersionsRepo(BuildTargetContext c) + private static void UpdateVersionsRepo(BuildTargetContext c) { string githubAuthToken = EnvVars.EnsureVariable("GITHUB_PASSWORD"); - string nupkgFilePath = EnvVars.EnsureVariable("NUPKG_FILE_PATH"); - string versionsRepoPath = EnvVars.EnsureVariable("VERSIONS_REPO_PATH"); + string nupkgFilePath = Dirs.Packages; + string branchName = c.BuildContext.Get("BranchName"); + string versionsRepoPath = $"build-info/dotnet/cli/{branchName}/Latest"; VersionRepoUpdater repoUpdater = new VersionRepoUpdater(githubAuthToken); repoUpdater.UpdatePublishedVersions(nupkgFilePath, versionsRepoPath).Wait(); - - return c.Success(); } } }