Check if NUGET_API_KEY can be accessed

This commit is contained in:
Kevin Sommer 2021-05-14 21:47:27 +02:00 committed by Keivn Sommer
parent 034730bffb
commit 1e29271fd9
3 changed files with 12 additions and 1 deletions

View File

@ -30,3 +30,5 @@ jobs:
- uses: actions/checkout@v1
- name: Run './build.cmd CiPublish'
run: ./build.cmd CiPublish
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

View File

@ -43,6 +43,9 @@
"type": "boolean",
"description": "Disables displaying the NUKE logo"
},
"NUGET_API_KEY": {
"type": "string"
},
"Plan": {
"type": "boolean",
"description": "Shows the execution plan (HTML)"

View File

@ -1,4 +1,5 @@
using System.Linq;
using Colorful;
using Nuke.Common;
using Nuke.Common.CI;
using Nuke.Common.CI.GitHubActions;
@ -22,7 +23,8 @@ using static Nuke.Common.Tools.DotNet.DotNetTasks;
OnPushBranches = new[] {"master", "releases/*"},
AutoGenerate = true,
InvokedTargets = new[] {nameof(CiPublish)},
CacheKeyFiles = new string[0])]
CacheKeyFiles = new string[0],
ImportSecrets = new[] {"NUGET_API_KEY"})]
class Build : NukeBuild
{
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
@ -34,6 +36,9 @@ class Build : NukeBuild
[Solution] readonly Solution Solution;
// ReSharper disable once InconsistentNaming
[Parameter] string NUGET_API_KEY;
Project SieveProject => Solution.AllProjects.First(p => p.Name == "Sieve");
AbsolutePath OutputDirectory => RootDirectory / "output";
@ -91,6 +96,7 @@ class Build : NukeBuild
.DependsOn(Package)
.Executes(() =>
{
Console.WriteLine(string.IsNullOrEmpty(NUGET_API_KEY));
});
Target Ci => _ => _