private IEnumerable <GitHubActionsStep> GetSteps(GitHubActionsImage image, IReadOnlyCollection <ExecutableTarget> relevantTargets) { yield return(new GitHubActionsUsingStep { Using = "actions/checkout@v1" }); yield return(new GitHubActionsRunStep { Command = $"./{BuildCmdPath} {InvokedTargets.JoinSpace()}", Imports = GetImports().ToDictionary(x => x.key, x => x.value) }); var artifacts = relevantTargets .SelectMany(x => ArtifactExtensions.ArtifactProducts[x.Definition]) .Select(x => (AbsolutePath)x) // TODO: https://github.com/actions/upload-artifact/issues/11 .Select(x => x.DescendantsAndSelf(y => y.Parent).FirstOrDefault(y => !y.ToString().ContainsOrdinalIgnoreCase("*"))) .Distinct().ToList(); foreach (var artifact in artifacts) { yield return(new GitHubActionsArtifactStep { Name = artifact.ToString().TrimStart(artifact.Parent.ToString()).TrimStart('/', '\\'), Path = NukeBuild.RootDirectory.GetUnixRelativePathTo(artifact) }); } }
public GitHubActionsAttribute( string name, GitHubActionsImage image, params GitHubActionsImage[] images) { _name = name; _images = new[] { image }.Concat(images).ToArray(); }
public GitHubActionsAttribute( string name, GitHubActionsImage image, params GitHubActionsImage[] images) { _name = name.Replace(oldChar: ' ', newChar: '_'); _images = new[] { image }.Concat(images).ToArray(); }
protected virtual GitHubActionsJob GetJobs(GitHubActionsImage image, IReadOnlyCollection <ExecutableTarget> relevantTargets) { return(new GitHubActionsJob { Name = image.GetValue().Replace(".", "_"), Steps = GetSteps(image, relevantTargets).ToArray(), Image = image }); }
protected override GitHubActionsJob GetJobs(GitHubActionsImage image, IReadOnlyCollection <ExecutableTarget> relevantTargets) { var job = base.GetJobs(image, relevantTargets); var newSteps = new List <GitHubActionsStep>(job.Steps); foreach (var version in new[] { "6.0.*", "5.0.*", "3.1.*", "2.1.*" }) { newSteps.Insert(1, new GitHubActionsSetupDotNetStep { Version = version }); } job.Steps = newSteps.ToArray(); return(job); }
public CustomGitHubActionsAttribute(string name, GitHubActionsImage image, params GitHubActionsImage[] images) : base(name, image, images) { }
public TestGitHubActionsAttribute(GitHubActionsImage image, params GitHubActionsImage[] images) : base("test", image, images) { }