private void NugetPublish(ITaskContext context)
 {
     context.CoreTasks().NugetPush(
         Path.Combine(PackagesFolder, NugetPackageName(context)))
     .ServerUrl("https://www.nuget.org/api/v2/package")
     .ApiKey(NuGetAPIKey).Execute(context);
 }
    private static void PublishNuGetPackage(ITaskContext context)
    {
        var version      = context.Properties.GetBuildVersion();
        var nugetVersion = version.ToString(3);

        var key = context.ScriptArgs["nugetKey"];

        context.CoreTasks().ExecuteDotnetTask("nuget")
        .DoNotFailOnError(e => { Console.WriteLine($"Failed to publish FlubuCore.WebApi.Model. exception: {e.Message}"); })
        .WithArguments("push")
        .WithArguments($"output\\FlubuCore.WebApi.Model.{nugetVersion}.nupkg")
        .WithArguments("-s", "https://www.nuget.org/api/v2/package")
        .WithArguments("-k", key).Execute(context);

        context.CoreTasks().ExecuteDotnetTask("nuget")
        .DoNotFailOnError(e => { Console.WriteLine($"Failed to publish FlubuCore.WebApi.Client. exception: {e.Message}"); })
        .WithArguments("push")
        .WithArguments($"output\\FlubuCore.WebApi.Client.{nugetVersion}.nupkg")
        .WithArguments("-s", "https://www.nuget.org/api/v2/package")
        .WithArguments("-k", key).Execute(context);

        context.CoreTasks().ExecuteDotnetTask("nuget")
        .DoNotFailOnError(e => { Console.WriteLine($"Failed to publish FlubuCore. exception: {e.Message}"); })
        .WithArguments("push")
        .WithArguments($"output\\FlubuCore.{nugetVersion}.nupkg")
        .WithArguments("-s", "https://www.nuget.org/api/v2/package")
        .WithArguments("-k", key).Execute(context);

        context.CoreTasks().ExecuteDotnetTask("nuget")
        .DoNotFailOnError(e => { Console.WriteLine($"Failed to publish dotnet-flubu. exception: {e.Message}"); })
        .WithArguments("push")
        .WithArguments($"output\\dotnet-flubu.{nugetVersion}.nupkg")
        .WithArguments("-s", "https://www.nuget.org/api/v2/package")
        .WithArguments("-k", key).Execute(context);

        var task = context.Tasks().PublishNuGetPackageTask("FlubuCore.Runner", @"Nuget\FlubuCoreRunner.nuspec");

        task.NugetServerUrl("https://www.nuget.org/api/v2/package")
        .DoNotFailOnError(e => { Console.WriteLine($"Failed to publish flubu.ruuner. exception: {e}"); })
        .ForApiKeyUse(key)
        .PushOnInteractiveBuild()
        .Execute(context);
    }
Exemple #3
0
        private static void PublishNuGetPackage(ITaskContext context)
        {
            var version      = context.Properties.GetBuildVersion();
            var nugetVersion = version.ToString(3);

            context.CoreTasks().NugetPush($"output\\FlubuCore.Gitter.{nugetVersion}.nupkg")
            .ForMember(x => x.ApiKey("Not provided"), "nugetKey", "Nuget api key.")
            .ServerUrl("https://www.nuget.org/api/v2/package")
            .Execute(context);
        }
Exemple #4
0
        private void PublishNuGetPackage(ITaskContext context)
        {
            var version      = context.Properties.GetBuildVersion();
            var nugetVersion = version.ToString(3);

            context.CoreTasks().NugetPush($"output/DotNetCore.Natasha.NCaller.{nugetVersion}.nupkg")
            .DoNotFailOnError((e) => { context.LogInfo($"Failed to publish Nuget package."); })
            .WithArguments("-s", "https://www.nuget.org/api/v2/package")
            .ApiKey(NugetApiKey)
            .Execute(context);
        }
Exemple #5
0
        private void NugetPush2(ITaskContext context)
        {
            var nugetPackages = context.GetFiles(OutputDir, "*.snupkg").Where(x => x.FileName.Contains(Version));

            foreach (var nugetPackage in nugetPackages)
            {
                context.CoreTasks().NugetPush(nugetPackage)
                .ServerUrl("https://api.nuget.org/v3/index.json")
                .ApiKey(NugetKey)
                .Execute(context);
            }
        }
Exemple #6
0
    private static void TargetPackageDotnetFlubu(ITaskContext context)
    {
        context.CoreTasks().Publish("dotnet-flubu").Framework("netcoreapp2.0").Execute(context);
        if (!Directory.Exists(@"output/dotnet-flubu"))
        {
            Directory.CreateDirectory(@"output/dotnet-flubu");
        }

        context.Tasks().PackageTask(@"output/dotnet-flubu")
        .AddDirectoryToPackage(@"dotnet-flubu/bin/Release/netcoreapp2.0/publish", "", true)
        .ZipPackage("dotnet-flubu", true)
        .Execute(context);
    }
        public void NugetPublish(ITaskContext context)
        {
            var nugetPackages = context.GetFiles(OutputDir, "*.nupkg");

            foreach (var nugetPackage in nugetPackages)
            {
                context.CoreTasks().NugetPush(nugetPackage)
                .ApiKey(NugetApiKey)
                .ServerUrl("https://www.nuget.org/api/v2/package")
                .DoNotFailOnError()
                .Execute(context);
            }
        }
Exemple #8
0
    private void PublishNuGetPackage(ITaskContext context)
    {
        var version        = context.Properties.GetBuildVersion();
        var nugetVersion   = version.Version.ToString(3);
        var versionQuality = version.VersionQuality;

        if (!string.IsNullOrEmpty(versionQuality))
        {
            nugetVersion = $"{nugetVersion}{versionQuality}";
        }

        context.CoreTasks().NugetPush(Output.CombineWith($"FlubuCore.WebApi.Model.{nugetVersion}.nupkg"))
        .DoNotFailOnError(e => { Console.WriteLine($"Failed to publish FlubuCore.WebApi.Model. exception: {e.Message}"); })
        .ServerUrl("https://www.nuget.org/api/v2/package")
        .ApiKey(NugetApiKey).Execute(context);

        context.CoreTasks().NugetPush(Output.CombineWith($"FlubuCore.WebApi.Client.{nugetVersion}.nupkg"))
        .DoNotFailOnError(e => { Console.WriteLine($"Failed to publish FlubuCore.WebApi.Client. exception: {e.Message}"); })
        .ServerUrl("https://www.nuget.org/api/v2/package")
        .ApiKey(NugetApiKey).Execute(context);

        context.CoreTasks().NugetPush(Output.CombineWith($"FlubuCore.{nugetVersion}.nupkg"))
        .DoNotFailOnError(e => { Console.WriteLine($"Failed to publish FlubuCore. exception: {e.Message}"); })
        .ServerUrl("https://www.nuget.org/api/v2/package")
        .ApiKey(NugetApiKey).Execute(context);

        context.CoreTasks().NugetPush(Output.CombineWith($"dotnet-flubu.{nugetVersion}.nupkg"))
        .DoNotFailOnError(e => { Console.WriteLine($"Failed to publish dotnet-flubu. exception: {e.Message}"); })
        .ServerUrl("https://www.nuget.org/api/v2/package")
        .ApiKey(NugetApiKey).Execute(context);

        context.CoreTasks().NugetPush(Output.CombineWith($"FlubuCore.Tool.{nugetVersion}.nupkg"))
        .DoNotFailOnError(e => { Console.WriteLine($"Failed to publish FlubuCore.GlobalTool. exception: {e.Message}"); })
        .ServerUrl("https://www.nuget.org/api/v2/package")
        .ApiKey(NugetApiKey).Execute(context);

        context.CoreTasks().NugetPush(Output.CombineWith($"FlubuCore.GlobalTool.{nugetVersion}.nupkg"))
        .DoNotFailOnError(e => { Console.WriteLine($"Failed to publish FlubuCore.GlobalTool. exception: {e.Message}"); })
        .ServerUrl("https://www.nuget.org/api/v2/package")
        .ApiKey(NugetApiKey).Execute(context);

        context.CoreTasks().NugetPush(Output.CombineWith("FlubuCore.Analyzers.1.0.4.nupkg"))
        .DoNotFailOnError(e => { Console.WriteLine($"Failed to publish FlubuCore.Analyzer. exception: {e.Message}"); })
        .ServerUrl("https://www.nuget.org/api/v2/package")
        .ApiKey(NugetApiKey).Execute(context);

        var task = context.Tasks().PublishNuGetPackageTask("FlubuCore.Runner", @"Nuget\FlubuCoreRunner.nuspec");

        task.NugetServerUrl("https://www.nuget.org/api/v2/package")
        .DoNotFailOnError(e => { Console.WriteLine($"Failed to publish flubu.ruuner. exception: {e}"); })
        .ForApiKeyUse(NugetApiKey)
        .Execute(context);
    }
Exemple #9
0
        private void PublishNuGetPackage(ITaskContext context)
        {
            var packageFiles = Directory.GetFiles(context.Properties.GetOutputDir(), "*.nupkg");

            foreach (var packageFile in packageFiles)
            {
                if (packageFile.EndsWith("symbols.nupkg", StringComparison.OrdinalIgnoreCase))
                {
                    continue;
                }

                context.CoreTasks().NugetPush(packageFile)
                .DoNotFailOnError((e) => { context.LogInfo($"Failed to publish Nuget package."); })
                .ServerUrl("https://www.nuget.org/api/v2/package")
                .ApiKey(NugetApiKey)
                .Execute(context);
            }
        }