integrate @krwq 's moniker/compile version changes
unset the hardcoded channel fix version badge version fix a capitalization fix the archives Update filenames of zip files to have the correct versions move version gen
This commit is contained in:
parent
f596b8ddce
commit
71b78a9c68
4 changed files with 27 additions and 21 deletions
|
@ -375,7 +375,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
}
|
||||
|
||||
// Generate .version file
|
||||
var version = buildVersion.SimpleVersion;
|
||||
var version = buildVersion.NuGetVersion;
|
||||
var content = $@"{c.BuildContext["CommitHash"]}{Environment.NewLine}{version}{Environment.NewLine}";
|
||||
File.WriteAllText(Path.Combine(outputDir, ".version"), content);
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
|
||||
c.BuildContext["Configuration"] = configEnv;
|
||||
c.BuildContext["Channel"] = Environment.GetEnvironmentVariable("CHANNEL");
|
||||
c.BuildContext["SharedFrameworkNugetVersion"] = GetVersionFromProjectJson(Path.Combine(Dirs.RepoRoot, "src", "sharedframework", "framework", "project.json"));
|
||||
|
||||
c.Info($"Building {c.BuildContext["Configuration"]} to: {Dirs.Output}");
|
||||
c.Info("Build Environment:");
|
||||
|
@ -83,6 +82,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
};
|
||||
c.BuildContext["BuildVersion"] = buildVersion;
|
||||
c.BuildContext["CommitHash"] = commitHash;
|
||||
c.BuildContext["SharedFrameworkNugetVersion"] = GetVersionFromProjectJson(Path.Combine(Dirs.RepoRoot, "src", "sharedframework", "framework", "project.json"));
|
||||
|
||||
c.Info($"Building Version: {buildVersion.SimpleVersion} (NuGet Packages: {buildVersion.NuGetVersion})");
|
||||
c.Info($"From Commit: {commitHash}");
|
||||
|
@ -122,11 +122,14 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
var versionBadgeName = $"{CurrentPlatform.Current}_{CurrentArchitecture.Current}_{config}_version_badge.svg";
|
||||
c.BuildContext["VersionBadge"] = Path.Combine(Dirs.Output, versionBadgeName);
|
||||
|
||||
AddInstallerArtifactToContext(c, "dotnet-sdk", "Sdk");
|
||||
AddInstallerArtifactToContext(c, "dotnet-host", "SharedHost");
|
||||
AddInstallerArtifactToContext(c, "dotnet-sharedframework", "SharedFramework");
|
||||
AddInstallerArtifactToContext(c, "dotnet-dev", "CombinedFrameworkSDKHost");
|
||||
AddInstallerArtifactToContext(c, "dotnet", "CombinedFrameworkHost");
|
||||
var cliVersion = c.BuildContext.Get<BuildVersion>("BuildVersion").NuGetVersion;
|
||||
var sharedFrameworkVersion = c.BuildContext.Get<string>("SharedFrameworkNugetVersion");
|
||||
|
||||
AddInstallerArtifactToContext(c, "dotnet-sdk", "Sdk", cliVersion);
|
||||
AddInstallerArtifactToContext(c, "dotnet-host", "SharedHost", cliVersion);
|
||||
AddInstallerArtifactToContext(c, "dotnet-sharedframework", "SharedFramework", sharedFrameworkVersion);
|
||||
AddInstallerArtifactToContext(c, "dotnet-dev", "CombinedFrameworkSDKHost", cliVersion);
|
||||
AddInstallerArtifactToContext(c, "dotnet", "CombinedFrameworkHost", sharedFrameworkVersion);
|
||||
|
||||
return c.Success();
|
||||
}
|
||||
|
@ -370,9 +373,13 @@ cmake is required to build the native host 'corehost'";
|
|||
return dict;
|
||||
}
|
||||
|
||||
private static void AddInstallerArtifactToContext(BuildTargetContext c, string artifactPrefix, string contextPrefix)
|
||||
private static void AddInstallerArtifactToContext(
|
||||
BuildTargetContext c,
|
||||
string artifactPrefix,
|
||||
string contextPrefix,
|
||||
string version)
|
||||
{
|
||||
var productName = Monikers.GetProductMoniker(c, artifactPrefix);
|
||||
var productName = Monikers.GetProductMoniker(c, artifactPrefix, version);
|
||||
|
||||
var extension = CurrentPlatform.IsWindows ? ".zip" : ".tar.gz";
|
||||
c.BuildContext[contextPrefix + "CompressedFile"] = Path.Combine(Dirs.Packages, productName + extension);
|
||||
|
|
|
@ -30,8 +30,8 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
AzurePublisherTool = new AzurePublisher();
|
||||
DebRepoPublisherTool = new DebRepoPublisher(Dirs.Packages);
|
||||
|
||||
CliVersion = c.BuildContext.Get<BuildVersion>("BuildCliVersion").SimpleVersion;
|
||||
CliNuGetVersion = c.BuildContext.Get<BuildVersion>("BuildCliVersion").NuGetVersion;
|
||||
CliVersion = c.BuildContext.Get<BuildVersion>("BuildVersion").SimpleVersion;
|
||||
CliNuGetVersion = c.BuildContext.Get<BuildVersion>("BuildVersion").NuGetVersion;
|
||||
SharedFrameworkNugetVersion = c.BuildContext.Get<string>("SharedFrameworkNugetVersion");
|
||||
Channel = c.BuildContext.Get<string>("Channel");
|
||||
|
||||
|
@ -82,12 +82,12 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
[Target]
|
||||
public static BuildTargetResult PublishCliVersionBadge(BuildTargetContext c)
|
||||
{
|
||||
var CliversionBadge = c.BuildContext.Get<string>("CliVersionBadge");
|
||||
var latestCliVersionBadgeBlob = $"{Channel}/Binaries/Latest/{Path.GetFileName(CliversionBadge)}";
|
||||
var CliversionBadgeBlob = $"{Channel}/Binaries/{CliVersion}/{Path.GetFileName(CliversionBadge)}";
|
||||
var versionBadge = c.BuildContext.Get<string>("VersionBadge");
|
||||
var latestVersionBadgeBlob = $"{Channel}/Binaries/Latest/{Path.GetFileName(versionBadge)}";
|
||||
var versionBadgeBlob = $"{Channel}/Binaries/{CliNuGetVersion}/{Path.GetFileName(versionBadge)}";
|
||||
|
||||
AzurePublisherTool.PublishFile(CliversionBadgeBlob, CliversionBadge);
|
||||
AzurePublisherTool.PublishFile(latestCliVersionBadgeBlob, CliversionBadge);
|
||||
AzurePublisherTool.PublishFile(versionBadgeBlob, versionBadge);
|
||||
AzurePublisherTool.PublishFile(latestVersionBadgeBlob, versionBadge);
|
||||
return c.Success();
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
public static BuildTargetResult PublishSdkInstallerFileToAzure(BuildTargetContext c)
|
||||
{
|
||||
var version = CliNuGetVersion;
|
||||
var installerFile = c.BuildContext.Get<string>("SDKInstallerFile");
|
||||
var installerFile = c.BuildContext.Get<string>("SdkInstallerFile");
|
||||
|
||||
AzurePublisherTool.PublishInstallerFileAndLatest(installerFile, Channel, version);
|
||||
|
||||
|
@ -157,7 +157,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
var version = CliNuGetVersion;
|
||||
var archiveFile = c.BuildContext.Get<string>("CombinedFrameworkSDKHostCompressedFile");
|
||||
|
||||
AzurePublisherTool.PublishInstallerFileAndLatest(archiveFile, Channel, version);
|
||||
AzurePublisherTool.PublishArchiveAndLatest(archiveFile, Channel, version);
|
||||
|
||||
return c.Success();
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
var version = SharedFrameworkNugetVersion;
|
||||
var archiveFile = c.BuildContext.Get<string>("CombinedFrameworkHostCompressedFile");
|
||||
|
||||
AzurePublisherTool.PublishInstallerFileAndLatest(archiveFile, Channel, version);
|
||||
AzurePublisherTool.PublishArchiveAndLatest(archiveFile, Channel, version);
|
||||
return c.Success();
|
||||
}
|
||||
|
||||
|
|
|
@ -10,11 +10,10 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
public const string SharedFrameworkName = "Microsoft.NETCore.App";
|
||||
|
||||
public static string GetProductMoniker(BuildTargetContext c, string artifactPrefix)
|
||||
public static string GetProductMoniker(BuildTargetContext c, string artifactPrefix, string version)
|
||||
{
|
||||
string osname = GetOSShortName();
|
||||
var arch = CurrentArchitecture.Current.ToString();
|
||||
var version = c.BuildContext.Get<BuildVersion>("BuildVersion").SimpleVersion;
|
||||
return $"{artifactPrefix}-{osname}-{arch}.{version}";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue