Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
Improved build
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Jul 5, 2024
1 parent d41f2fc commit 8b42581
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
}

const string defaultNuGetSource = "https://api.nuget.org/v3/index.json";
Environment.SetEnvironmentVariable("DOTNET_NUGET_SIGNATURE_VERIFICATION", "false");
var configuration = GetProperty("configuration", "Release");
var apiKey = GetProperty("apiKey", "");
var integrationTests = bool.Parse(GetProperty("integrationTests", UnderTeamCity.ToString()));
var defaultVersion = NuGetVersion.Parse(GetProperty("version", "1.0.0-dev", UnderTeamCity));
var integrationTests = bool.Parse(GetProperty("integrationTests", CI.ToString()));
var defaultVersion = NuGetVersion.Parse(GetProperty("version", "1.0.0-dev", CI));
var outputDir = Path.Combine(currentDir, "CSharpInteractive", "bin", configuration);
var templateOutputDir = Path.Combine(currentDir, "CSharpInteractive.Templates", "bin", configuration);
var dockerLinuxTests = HasLinuxDocker();
Expand Down
7 changes: 5 additions & 2 deletions Build/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
using HostApi;
using NuGet.Versioning;
// ReSharper disable CheckNamespace
// ReSharper disable InconsistentNaming

internal static class Tools
{
public static bool UnderTeamCity => Environment.GetEnvironmentVariable("TEAMCITY_VERSION") != default;
public static bool CI =>
Environment.GetEnvironmentVariable("TEAMCITY_VERSION") is not null
|| Environment.GetEnvironmentVariable("CI") == "true";

public static NuGetVersion GetNextNuGetVersion(NuGetRestoreSettings settings, NuGetVersion defaultVersion)
{
Expand Down Expand Up @@ -94,7 +97,7 @@ public static void Run(ICommandLine commandLine)

public static void Exit()
{
if (!Console.IsInputRedirected && !UnderTeamCity)
if (!Console.IsInputRedirected && !CI)
{
var foregroundColor = Console.ForegroundColor;
try
Expand Down

0 comments on commit 8b42581

Please sign in to comment.