private static void PublishNuGet(ICakeContext ctx, TaskConfig cfg, NuGetPublisher nuget)
        {
            EnvConfig env = cfg.Load <EnvConfig>();

            ctx.DotNetCorePack(nuget.ProjectFile, new DotNetCorePackSettings
            {
                Configuration         = env.Configuration,
                OutputDirectory       = nuget.OutputLocation,
                Verbosity             = ctx.Log.Verbosity.ToVerbosity(),
                ArgumentCustomization = arg =>
                {
                    arg.Append($"/p:Version={env.Version.Build}");
                    if (nuget.PublishAsSnupkg)
                    {
                        arg.Append("/p:SymbolPackageFormat=snupkg");
                    }
                    return(arg);
                },
                IncludeSource  = true,
                IncludeSymbols = true,
            });

            IEnumerable <string> packageFiles = Directory.EnumerateFiles(nuget.OutputLocation,
                                                                         nuget.PublishAsSnupkg ? "*.snupkg" : "*.nupkg");

            foreach (string packageFile in packageFiles)
            {
                ctx.DotNetCoreNuGetPush(packageFile, new DotNetCoreNuGetPushSettings
                {
                    Source = nuget.Source(env.Branch),
                    ApiKey = nuget.ApiKey?.Invoke(env.Branch),
                });
            }
        }
Example #2
0
 public ProjectIdMandatory(NuGetPublisher parent) : base(parent)
 {
 }
Example #3
0
 public ApiKeyMandatory(NuGetPublisher parent)
     : base(parent)
 {
 }
 public DescriptionMandatory(NuGetPublisher parent)
     : base(parent)
 {
 }
 public ProjectIdMandatory(NuGetPublisher parent)
     : base(parent)
 {
 }
 public DescriptionMandatory(NuGetPublisher parent) : base(parent)
 {
 }
Example #7
0
 public OptionBase(NuGetPublisher parent)
 {
     _parent = parent;
 }
Example #8
0
 public OptionBase(NuGetPublisher parent)
 {
     _parent = parent;
 }
Example #9
0
 public ApiKeyMandatory(NuGetPublisher parent) : base(parent)
 {
 }