private static void AddInstallerArtifactToContext( BuildTargetContext c, string artifactPrefix, string contextPrefix, string version) { var productName = Monikers.GetProductMoniker(c, artifactPrefix, version); var extension = CurrentPlatform.IsWindows ? ".zip" : ".tar.gz"; c.BuildContext[contextPrefix + "CompressedFile"] = Path.Combine(Dirs.Packages, productName + extension); string installer = ""; switch (CurrentPlatform.Current) { case BuildPlatform.Windows: if (contextPrefix.Contains("Combined")) { installer = productName + ".exe"; } else { installer = productName + ".msi"; } break; case BuildPlatform.OSX: installer = productName + ".pkg"; break; case BuildPlatform.Ubuntu: installer = productName + ".deb"; break; default: break; } if (!string.IsNullOrEmpty(installer)) { c.BuildContext[contextPrefix + "InstallerFile"] = Path.Combine(Dirs.Packages, installer); } }
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()); }