Skip to content

Commit

Permalink
Merge pull request #1436 from nunit/issue-1428b
Browse files Browse the repository at this point in the history
Fix Build script problems with api keys
  • Loading branch information
CharliePoole authored Jul 2, 2024
2 parents c4d49d0 + ad6848a commit 48d96aa
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions cake/build-settings.cake
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,22 @@ public static class BuildSettings
? CommandLineOptions.TestLevel.Value
: CalcPackageTestLevel();

// Publishing
// Publishing - MyGet
public static string MyGetPushUrl => MYGET_PUSH_URL;
public static string MyGetApiKey => Context.EnvironmentVariable(MYGET_API_KEY);

// Publishing - NuGet
public static string NuGetPushUrl => NUGET_PUSH_URL;
public static string NuGetApiKey => Context.EnvironmentVariable(NUGET_API_KEY);

// Publishing - Chocolatey
public static string ChocolateyPushUrl => CHOCO_PUSH_URL;
public static string ChocolateyApiKey => Context.EnvironmentVariable(CHOCO_API_KEY);

public static string MyGetApiKey { get; private set; }
public static string NuGetApiKey { get; private set; }
public static string ChocolateyApiKey { get; private set;}
public static string GitHubOwner { get; private set; }
public static string GitHubRepository { get; private set; }
public static string GitHubAccessToken { get; private set; }
// Publishing - GitHub
public static string GitHubOwner { get; set; }
public static string GitHubRepository { get; set; }
public static string GitHubAccessToken => Context.EnvironmentVariable(GITHUB_ACCESS_TOKEN);

public static bool IsPreRelease => BuildVersion.IsPreRelease;
public static bool ShouldPublishToMyGet =>
Expand Down Expand Up @@ -318,6 +323,7 @@ public static class BuildSettings
Console.WriteLine("MyGetApiKey: " + (!string.IsNullOrEmpty(MyGetApiKey) ? "AVAILABLE" : "NOT AVAILABLE"));
Console.WriteLine("NuGetApiKey: " + (!string.IsNullOrEmpty(NuGetApiKey) ? "AVAILABLE" : "NOT AVAILABLE"));
Console.WriteLine("ChocolateyApiKey: " + (!string.IsNullOrEmpty(ChocolateyApiKey) ? "AVAILABLE" : "NOT AVAILABLE"));
Console.WriteLine("GitHubAccessToken: " + (!string.IsNullOrEmpty(GitHubAccessToken) ? "AVAILABLE" : "NOT AVAILABLE"));

Console.WriteLine("\nPACKAGES");
foreach (var package in Packages)
Expand Down

0 comments on commit 48d96aa

Please sign in to comment.