Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Build script problems with api keys #1436

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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