mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
* add sourcelink support * Update sourcelink (2.0.2 -> 2.1.0) * Add parameter to enable source linking * tidy up the arguments with an extension method allowing an argument to be conditionally appended * Add an explicit "test sourcelink" build task and remove the MSBuild one, so we can get some build script output without needing the whole build to be in verbose logging * run sourcelink test against the NuGet packages
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using System;
|
|
using Cake.Common;
|
|
using Cake.Common.Diagnostics;
|
|
using Cake.Common.IO;
|
|
using Cake.Core;
|
|
using Cake.Core.IO;
|
|
using Cake.Frosting;
|
|
|
|
[Dependency(typeof(Package))]
|
|
public class TestSourceLink : FrostingTask<Context>
|
|
{
|
|
public override void Run(Context context)
|
|
{
|
|
var nugetPackages = context.GetFiles($"./{context.Artifacts}/*.nupkg");
|
|
|
|
foreach (var nugetPackage in nugetPackages)
|
|
{
|
|
context.Information("Testing sourcelink info in {0}", context.Environment.WorkingDirectory.GetRelativePath(nugetPackage));
|
|
var exitCode = context.StartProcess("dotnet", new ProcessSettings
|
|
{
|
|
WorkingDirectory = "Octokit",
|
|
Arguments = $"sourcelink test {nugetPackage.FullPath}"
|
|
});
|
|
|
|
if (exitCode != 0)
|
|
{
|
|
throw new Exception("Sourcelink test failed!");
|
|
}
|
|
}
|
|
}
|
|
|
|
public override bool ShouldRun(Context context)
|
|
{
|
|
return context.LinkSources;
|
|
}
|
|
} |