Refactor the build scripts
- Bifurcate Package and Publish targets to enable signing. - Move publish from bash/ps into c#. - Create multiple targets to create MSIs and Bundles.
This commit is contained in:
parent
781678de92
commit
d4a3190bfc
25 changed files with 754 additions and 577 deletions
|
@ -31,7 +31,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
public static BuildTargetResult CheckInstallerBuildPlatformDependencies(BuildTargetContext c) => c.Success();
|
||||
|
||||
// All major targets will depend on this in order to ensure variables are set up right if they are run independently
|
||||
[Target(nameof(GenerateVersions), nameof(CheckPrereqs), nameof(LocateStage0))]
|
||||
[Target(nameof(GenerateVersions), nameof(CheckPrereqs), nameof(LocateStage0), nameof(ExpectedBuildArtifacts))]
|
||||
public static BuildTargetResult Init(BuildTargetContext c)
|
||||
{
|
||||
var runtimeInfo = PlatformServices.Default.Runtime;
|
||||
|
@ -104,6 +104,41 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
return c.Success();
|
||||
}
|
||||
|
||||
[Target]
|
||||
public static BuildTargetResult ExpectedBuildArtifacts(BuildTargetContext c)
|
||||
{
|
||||
var productName = Monikers.GetProductMoniker(c);
|
||||
var config = Environment.GetEnvironmentVariable("CONFIGURATION");
|
||||
var versionBadgeName = $"{CurrentPlatform.Current}_{CurrentArchitecture.Current}_{config}_version_badge.svg";
|
||||
c.BuildContext["VersionBadge"] = Path.Combine(Dirs.Output, versionBadgeName);
|
||||
|
||||
var extension = CurrentPlatform.IsWindows ? ".zip" : ".tar.gz";
|
||||
c.BuildContext["CompressedFile"] = Path.Combine(Dirs.Packages, productName + extension);
|
||||
|
||||
string installer = "";
|
||||
switch(CurrentPlatform.Current)
|
||||
{
|
||||
case BuildPlatform.Windows:
|
||||
installer = productName + ".exe";
|
||||
break;
|
||||
case BuildPlatform.OSX:
|
||||
installer = productName + ".pkg";
|
||||
break;
|
||||
case BuildPlatform.Ubuntu:
|
||||
installer = productName + ".deb";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if(!string.IsNullOrEmpty(installer))
|
||||
{
|
||||
c.BuildContext["InstallerFile"] = Path.Combine(Dirs.Packages, installer);
|
||||
}
|
||||
|
||||
return c.Success();
|
||||
}
|
||||
|
||||
[Target]
|
||||
public static BuildTargetResult CheckPackageCache(BuildTargetContext c)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue