diff --git a/.build/Build.CI.cs b/.build/Build.CI.cs
index 631f245e..446e275a 100644
--- a/.build/Build.CI.cs
+++ b/.build/Build.CI.cs
@@ -19,29 +19,29 @@
)]
[GitHubActionsSteps(
"ci",
+ GitHubActionsImage.UbuntuLatest,
GitHubActionsImage.MacOsLatest,
GitHubActionsImage.WindowsLatest,
- GitHubActionsImage.UbuntuLatest,
AutoGenerate = false,
On = new[]
- {
- RocketSurgeonGitHubActionsTrigger.WorkflowCall,
- RocketSurgeonGitHubActionsTrigger.WorkflowDispatch,
- },
+ {
+ RocketSurgeonGitHubActionsTrigger.WorkflowCall,
+ RocketSurgeonGitHubActionsTrigger.WorkflowDispatch,
+ },
OnPushTags = new[] { "v*", },
OnPushBranches = new[] { "master", "main", "next", },
OnPullRequestBranches = new[] { "master", "main", "next", },
InvokedTargets = new[] { nameof(Default), },
NonEntryTargets = new[]
- {
- nameof(ICIEnvironment.CIEnvironment),
- nameof(ITriggerCodeCoverageReports.TriggerCodeCoverageReports),
- nameof(ITriggerCodeCoverageReports.GenerateCodeCoverageReportCobertura),
- nameof(IGenerateCodeCoverageBadges.GenerateCodeCoverageBadges),
- nameof(IGenerateCodeCoverageReport.GenerateCodeCoverageReport),
- nameof(IGenerateCodeCoverageSummary.GenerateCodeCoverageSummary),
- nameof(Default),
- },
+ {
+ nameof(ICIEnvironment.CIEnvironment),
+ nameof(ITriggerCodeCoverageReports.TriggerCodeCoverageReports),
+ nameof(ITriggerCodeCoverageReports.GenerateCodeCoverageReportCobertura),
+ nameof(IGenerateCodeCoverageBadges.GenerateCodeCoverageBadges),
+ nameof(IGenerateCodeCoverageReport.GenerateCodeCoverageReport),
+ nameof(IGenerateCodeCoverageSummary.GenerateCodeCoverageSummary),
+ nameof(Default),
+ },
ExcludedTargets = new[] { nameof(ICanClean.Clean), nameof(ICanRestoreWithDotNetCore.DotnetToolRestore), },
Enhancements = new[] { nameof(CiMiddleware), }
)]
@@ -82,12 +82,12 @@ public partial class Pipeline
public static RocketSurgeonGitHubActionsConfiguration CiIgnoreMiddleware(RocketSurgeonGitHubActionsConfiguration configuration)
{
( (RocketSurgeonsGithubActionsJob)configuration.Jobs[0] ).Steps = new()
- {
- new RunStep("N/A")
- {
- Run = "echo \"No build required\"",
- },
- };
+ {
+ new RunStep("N/A")
+ {
+ Run = "echo \"No build required\"",
+ },
+ };
return configuration.IncludeRepositoryConfigurationFiles();
}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8f4d6650..a53b6059 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -97,7 +97,7 @@ jobs:
NUGET_PACKAGES: '${{ github.workspace }}/.nuget/packages'
strategy:
matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
+ os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
@@ -139,39 +139,63 @@ jobs:
id: pack
run: |
dotnet nuke Pack --skip --thisisaothervariable '${{ vars.THIS_IS_A_VARIABLE }}' --thisisanothervariable '${{ vars.THIS_IS_ANOTHER_VARIABLE }}' --this_is_a_variable '${{ vars.THIS_IS_A_VARIABLE }}' --thisisaenv '${{ env.THIS_IS_A_ENV || 'test' }}' --thisisasecret '${{ secrets.THIS_IS_A_SECRET }}' --githubtoken '${{ secrets.GITHUB_TOKEN }}'
+ - name: 🏺 coverage (${{ matrix.os }})
+ if: matrix.os != 'ubuntu-latest'
+ uses: actions/upload-artifact@v4
+ with:
+ name: '${{ matrix.os }}-coverage'
+ path: 'coverage/'
- name: 🏺 Publish coverage data
- if: always()
- uses: actions/upload-artifact@v3.1.3
+ if: matrix.os == 'ubuntu-latest'
+ uses: actions/upload-artifact@v4
with:
- name: 'coverage'
+ name: '${{ matrix.os }}-coverage'
path: 'coverage/'
- name: 🐿 Publish Coverage
if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || ((github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.pull_request.user.login != 'renovate[bot]' && github.event.pull_request.user.login != 'dependabot[bot]')
- uses: codecov/codecov-action@v3.1.6
+ uses: codecov/codecov-action@v3
with:
name: 'actions-${{ matrix.os }}'
+ - name: 🏺 logs (${{ matrix.os }})
+ if: matrix.os != 'ubuntu-latest'
+ uses: actions/upload-artifact@v4
+ with:
+ name: '${{ matrix.os }}-logs'
+ path: 'artifacts/logs/'
- name: 🏺 Publish logs
- if: always()
- uses: actions/upload-artifact@v3.1.3
+ if: matrix.os == 'ubuntu-latest'
+ uses: actions/upload-artifact@v4
with:
- name: 'logs'
+ name: '${{ matrix.os }}-logs'
path: 'artifacts/logs/'
+ - name: 🏺 test data (${{ matrix.os }})
+ if: matrix.os != 'ubuntu-latest'
+ uses: actions/upload-artifact@v4
+ with:
+ name: '${{ matrix.os }}-test data'
+ path: 'artifacts/test/'
- name: 🏺 Publish test data
- if: always()
- uses: actions/upload-artifact@v3.1.3
+ if: matrix.os == 'ubuntu-latest'
+ uses: actions/upload-artifact@v4
with:
- name: 'test data'
+ name: '${{ matrix.os }}-test data'
path: 'artifacts/test/'
+ - name: 🏺 nuget (${{ matrix.os }})
+ if: matrix.os != 'ubuntu-latest'
+ uses: actions/upload-artifact@v4
+ with:
+ name: '${{ matrix.os }}-nuget'
+ path: 'artifacts/nuget/'
- name: 🏺 Publish NuGet Packages
- if: always()
- uses: actions/upload-artifact@v3.1.3
+ if: matrix.os == 'ubuntu-latest'
+ uses: actions/upload-artifact@v4
with:
- name: 'nuget'
+ name: '${{ matrix.os }}-nuget'
path: 'artifacts/nuget/'
Publish:
needs:
- Build
- uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.5
+ uses: RocketSurgeonsGuild/actions/.github/workflows/publish-nuget.yml@v0.3.0
secrets:
RSG_NUGET_API_KEY: '${{ secrets.RSG_NUGET_API_KEY }}'
RSG_AZURE_DEVOPS: '${{ secrets.RSG_AZURE_DEVOPS }}'
diff --git a/Directory.Build.targets b/Directory.Build.targets
index de8bfc33..7f99b71c 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -1,24 +1,28 @@
-
-
+
-
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
diff --git a/src/Nuke/EnsurePackageSourceHasCredentialsAttribute.cs b/src/Nuke/EnsurePackageSourceHasCredentialsAttribute.cs
index dfc13fc1..c452117c 100644
--- a/src/Nuke/EnsurePackageSourceHasCredentialsAttribute.cs
+++ b/src/Nuke/EnsurePackageSourceHasCredentialsAttribute.cs
@@ -32,20 +32,19 @@ public EnsurePackageSourceHasCredentialsAttribute(string sourceName)
///
public void OnBuildCreated(IReadOnlyCollection executableTargets)
{
- var settings = Settings.LoadDefaultSettings(NukeBuild.RootDirectory);
+ var settings = NuGet.Configuration.Settings.LoadDefaultSettings(NukeBuild.RootDirectory);
var packageSourceProvider = new PackageSourceProvider(settings);
- var source = packageSourceProvider.LoadPackageSources()
- .FirstOrDefault(
- x => x.Name.Equals(SourceName, StringComparison.OrdinalIgnoreCase)
- );
+ var source = packageSourceProvider
+ .LoadPackageSources()
+ .FirstOrDefault(x => x.Name.Equals(SourceName, StringComparison.OrdinalIgnoreCase));
if (source == null)
{
Log.Error(
"NuGet Package Source {SourceName} could not be found. This is required for the build to complete",
SourceName
);
- throw new Exception();
+ throw new();
}
if (source.Credentials?.IsValid() != true)
@@ -54,7 +53,7 @@ public void OnBuildCreated(IReadOnlyCollection executableTarge
"NuGet Package Source {SourceName} does not have any credentials defined. Please configure the credentials for the source to build",
SourceName
);
- throw new Exception();
+ throw new();
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Nuke/GithubActions/DownloadArtifactSet.cs b/src/Nuke/GithubActions/DownloadArtifactSet.cs
index 432295e9..99cd7645 100644
--- a/src/Nuke/GithubActions/DownloadArtifactSet.cs
+++ b/src/Nuke/GithubActions/DownloadArtifactSet.cs
@@ -3,6 +3,7 @@ namespace Rocket.Surgery.Nuke.GithubActions;
///
/// Download a given artifact
///
+[PublicAPI]
public class DownloadArtifactSet : UsingStep
{
///
@@ -15,15 +16,44 @@ public DownloadArtifactSet(string name) : base(name)
}
///
- /// The artifact name to download
+ /// Gets or sets the name of the artifact to download. If unspecified, all artifacts for the run are downloaded.
///
public string? Name { get; set; }
///
- /// The path of the artifact to download
+ /// Gets or sets the destination path. Supports basic tilde expansion. Optional. Default is $GITHUB_WORKSPACE.
///
public string? Path { get; set; }
+ ///
+ /// Gets or sets a glob pattern to the artifacts that should be downloaded. Ignored if name is specified.
+ ///
+ public string? Pattern { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether multiple artifacts are merged. If true, the downloaded artifacts will be in the same directory specified by path.
+ /// If false, the downloaded artifacts will be extracted into individual named directories within the specified path. Optional. Default is 'false'.
+ ///
+ public bool? MergeMultiple { get; set; }
+
+ ///
+ /// Gets or sets the GitHub token used to authenticate with the GitHub API. This is required when downloading artifacts from a different repository or from a
+ /// different workflow run.
+ ///
+ public string? GithubToken { get; set; }
+
+ ///
+ /// Gets or sets the repository owner and the repository name joined together by "/". If github-token is specified, this is the repository that artifacts will
+ /// be downloaded from.
+ ///
+ public string? Repository { get; set; }
+
+ ///
+ /// Gets or sets the id of the workflow run where the desired download artifact was uploaded from. If github-token is specified, this is the run that artifacts
+ /// will be downloaded from.
+ ///
+ public string? RunId { get; set; }
+
///
public override void Write(CustomFileWriter writer)
{
diff --git a/src/Nuke/GithubActions/GitHubActionsStepsAttribute.cs b/src/Nuke/GithubActions/GitHubActionsStepsAttribute.cs
index c9ca1708..e8dc35b9 100644
--- a/src/Nuke/GithubActions/GitHubActionsStepsAttribute.cs
+++ b/src/Nuke/GithubActions/GitHubActionsStepsAttribute.cs
@@ -99,10 +99,10 @@ public override ConfigurationEntity GetConfiguration(IReadOnlyCollection
{
return new[]
- {
- new KeyValuePair(z.Name, z),
- new KeyValuePair(z.Alias ?? z.Name.Pascalize(), z),
- };
+ {
+ new KeyValuePair(z.Name, z),
+ new KeyValuePair(z.Alias ?? z.Name.Pascalize(), z),
+ };
}
)
.DistinctBy(z => z.Key, StringComparer.OrdinalIgnoreCase)
@@ -144,32 +144,32 @@ public override ConfigurationEntity GetConfiguration(IReadOnlyCollection z.GroupByKey)
.Select(
static secrets => new UsingStep($"Load 1Password Secrets ({secrets.Key})")
- {
- Id = secrets.First().OutputId,
- Uses = "1password/load-secrets-action@v1",
- Outputs = secrets
- .Select(secret => new GitHubActionsOutput(secret.Name, secret.Description))
- .ToList(),
- With = new() { ["export-env"] = "false", },
- Environment = secrets
- .Select(
- z => new KeyValuePair(
- z.Name,
- string.IsNullOrWhiteSpace(z.Variable)
- ? $$$"""{{{z.Path}}}"""
- : $$$"""${{ vars.{{{z.Variable}}} }}/{{{z.Path.TrimStart('/')}}}"""
- )
- )
- .Concat(
- [
- new KeyValuePair(
- "OP_SERVICE_ACCOUNT_TOKEN",
- $$$"""${{ secrets.{{{secrets.First().OutputId}}} }}"""
- ),
- ]
- )
- .ToDictionary(z => z.Key, z => z.Value),
- }
+ {
+ Id = secrets.First().OutputId,
+ Uses = "1password/load-secrets-action@v1",
+ Outputs = secrets
+ .Select(secret => new GitHubActionsOutput(secret.Name, secret.Description))
+ .ToList(),
+ With = new() { ["export-env"] = "false", },
+ Environment = secrets
+ .Select(
+ z => new KeyValuePair(
+ z.Name,
+ string.IsNullOrWhiteSpace(z.Variable)
+ ? $$$"""{{{z.Path}}}"""
+ : $$$"""${{ vars.{{{z.Variable}}} }}/{{{z.Path.TrimStart('/')}}}"""
+ )
+ )
+ .Concat(
+ [
+ new KeyValuePair(
+ "OP_SERVICE_ACCOUNT_TOKEN",
+ $$$"""${{ secrets.{{{secrets.First().OutputId}}} }}"""
+ ),
+ ]
+ )
+ .ToDictionary(z => z.Key, z => z.Value),
+ }
)
);
}
@@ -205,36 +205,36 @@ public override ConfigurationEntity GetConfiguration(IReadOnlyCollection z.GroupByKey)
.Select(
static secrets => new UsingStep($"Load 1Password Secrets ({secrets.Key})")
- {
- Id = secrets.First().OutputId,
- Uses = "1password/load-secrets-action@v1",
- Outputs = secrets
- .Select(secret => new GitHubActionsOutput(secret.Name, secret.Description))
- .ToList(),
- With = new() { ["export-env"] = "false", },
- Environment = secrets
- .Select(
- z => new KeyValuePair(
- z.Name,
- string.IsNullOrWhiteSpace(z.Variable)
- ? $$$"""{{{z.Path}}}"""
- : $$$"""${{ vars.{{{z.Variable}}} }}/{{{z.Path.TrimStart('/')}}}"""
- )
- )
- .Concat(
- [
- new(
- "OP_CONNECT_HOST",
- $$$"""${{ vars.{{{secrets.First().ConnectHost}}} }}"""
- ),
- new KeyValuePair(
- "OP_CONNECT_TOKEN",
- $$$"""${{ secrets.{{{secrets.First().ConnectToken}}} }}"""
- ),
- ]
- )
- .ToDictionary(z => z.Key, z => z.Value),
- }
+ {
+ Id = secrets.First().OutputId,
+ Uses = "1password/load-secrets-action@v1",
+ Outputs = secrets
+ .Select(secret => new GitHubActionsOutput(secret.Name, secret.Description))
+ .ToList(),
+ With = new() { ["export-env"] = "false", },
+ Environment = secrets
+ .Select(
+ z => new KeyValuePair(
+ z.Name,
+ string.IsNullOrWhiteSpace(z.Variable)
+ ? $$$"""{{{z.Path}}}"""
+ : $$$"""${{ vars.{{{z.Variable}}} }}/{{{z.Path.TrimStart('/')}}}"""
+ )
+ )
+ .Concat(
+ [
+ new(
+ "OP_CONNECT_HOST",
+ $$$"""${{ vars.{{{secrets.First().ConnectHost}}} }}"""
+ ),
+ new KeyValuePair(
+ "OP_CONNECT_TOKEN",
+ $$$"""${{ secrets.{{{secrets.First().ConnectToken}}} }}"""
+ ),
+ ]
+ )
+ .ToDictionary(z => z.Key, z => z.Value),
+ }
)
);
}
@@ -242,9 +242,9 @@ public override ConfigurationEntity GetConfiguration(IReadOnlyCollection
{
return new[]
- {
- new KeyValuePair(z.Name, z),
- new KeyValuePair(z.Alias ?? z.Name.Pascalize(), z),
- };
+ {
+ new KeyValuePair(z.Name, z),
+ new KeyValuePair(z.Alias ?? z.Name.Pascalize(), z),
+ };
}
)
.DistinctBy(z => z.Key, StringComparer.OrdinalIgnoreCase)
@@ -361,41 +361,41 @@ public override ConfigurationEntity GetConfiguration(IReadOnlyCollection z.ToWorkflow("build"));
-
- var buildJob = new RocketSurgeonsGithubActionsJob("build")
- {
- Steps = steps,
- Outputs = jobOutputs,
- RunsOn = !_isGithubHosted ? _images : Array.Empty(),
- Matrix = _isGithubHosted ? _images : Array.Empty(),
- // TODO: Figure out what this looks like here
- // Environment = inputs
- // .Concat(GetAllSecrets(secrets))
- // .Concat(variables)
- // .Select(
- // z => new KeyValuePair(
- // $"{( z.Prefix.Equals("ENV", StringComparison.OrdinalIgnoreCase) ? "" : $"{z.Prefix.ToUpperInvariant()}_" )}{( z.Alias ?? z.Name ).ToUpperInvariant()}",
- // $$$"""${{ {{{z.Prefix}}}.{{{z.Name}}} }}"""
- // )
- // )
- // .ToDictionary(z => z.Key, z => z.Value, StringComparer.OrdinalIgnoreCase)
- };
+ var outputs = jobOutputs.Select(z => z.ToWorkflow(Settings.DefaultGithubJobName));
+
+ var buildJob = new RocketSurgeonsGithubActionsJob(Settings.DefaultGithubJobName)
+ {
+ Steps = steps,
+ Outputs = jobOutputs,
+ RunsOn = !_isGithubHosted ? _images : Array.Empty(),
+ Matrix = _isGithubHosted ? _images : Array.Empty(),
+ // TODO: Figure out what this looks like here
+ // Environment = inputs
+ // .Concat(GetAllSecrets(secrets))
+ // .Concat(variables)
+ // .Select(
+ // z => new KeyValuePair(
+ // $"{( z.Prefix.Equals("ENV", StringComparison.OrdinalIgnoreCase) ? "" : $"{z.Prefix.ToUpperInvariant()}_" )}{( z.Alias ?? z.Name ).ToUpperInvariant()}",
+ // $$$"""${{ {{{z.Prefix}}}.{{{z.Name}}} }}"""
+ // )
+ // )
+ // .ToDictionary(z => z.Key, z => z.Value, StringComparer.OrdinalIgnoreCase)
+ };
// ReSharper disable once PossibleMultipleEnumeration
var triggers = GetTriggers(requiredInputs, outputs, secrets).ToArray();
var config = new RocketSurgeonGitHubActionsConfiguration
- {
- Name = Name,
- DetailedTriggers = triggers.ToList(),
- // TODO: Figure out what this looks like here
- // Environment = environmentAttributes
- Jobs = new() { buildJob, },
- };
+ {
+ Name = Name,
+ DetailedTriggers = triggers.ToList(),
+ // TODO: Figure out what this looks like here
+ // Environment = environmentAttributes
+ Jobs = new() { buildJob, },
+ };
ApplyEnhancements(config);
- if (!buildJob.Name.Equals("build", StringComparison.OrdinalIgnoreCase))
+ if (!buildJob.Name.Equals(Settings.DefaultGithubJobName, StringComparison.OrdinalIgnoreCase))
{
// ReSharper disable once PossibleMultipleEnumeration
config.DetailedTriggers = GetTriggers(requiredInputs, outputs, secrets)
@@ -403,6 +403,33 @@ public override ConfigurationEntity GetConfiguration(IReadOnlyCollection 1, })
+ {
+ var mainOs = _images.First();
+ foreach (var step in steps.OfType().ToList())
+ {
+ steps.Insert(
+ steps.IndexOf(step),
+ new UploadArtifactStep($$$"""{{{step.Name}}} (${{ matrix.os }})""")
+ {
+ If = $"matrix.os != '{mainOs}'",
+ Name = $$$"""${{ matrix.os }}-{{{step.Name}}}""",
+ Path = step.Path,
+ Environment = step.Environment,
+ Outputs = step.Outputs,
+ With = step.With,
+ Uses = step.Uses,
+ Overwrite = step.Overwrite,
+ CompressionLevel = step.CompressionLevel,
+ ContinueOnError = step.ContinueOnError,
+ RetentionDays = step.RetentionDays,
+ IfNoFilesFound = step.IfNoFilesFound,
+ }
+ );
+ step.If = $"matrix.os == '{mainOs}'";
+ }
+ }
+
return config;
}
@@ -437,10 +464,10 @@ protected virtual IEnumerable GetParameters(INukeBui
}
yield return new()
- {
- Name = parameter.GetCustomAttribute()?.Name ?? parameter.Name,
- Default = value?.ToString() ?? "",
- };
+ {
+ Name = parameter.GetCustomAttribute()?.Name ?? parameter.Name,
+ Default = value?.ToString() ?? "",
+ };
}
}
}
diff --git a/src/Nuke/GithubActions/UploadArtifactStep.cs b/src/Nuke/GithubActions/UploadArtifactStep.cs
index 67cfd684..85b175b1 100644
--- a/src/Nuke/GithubActions/UploadArtifactStep.cs
+++ b/src/Nuke/GithubActions/UploadArtifactStep.cs
@@ -3,6 +3,7 @@ namespace Rocket.Surgery.Nuke.GithubActions;
///
/// The upload artifact step
///
+[PublicAPI]
public class UploadArtifactStep : UsingStep
{
///
@@ -11,18 +12,38 @@ public class UploadArtifactStep : UsingStep
///
public UploadArtifactStep(string name) : base(name)
{
- Uses = "actions/upload-artifact@v3";
+ Uses = "actions/upload-artifact@v4";
}
///
- /// The name of artifact to upload
+ /// Gets or sets the name of the artifact to upload. Optional. Default is 'artifact'.
///
- public string? Name { get; set; }
+ public string Name { get; set; } = "artifact";
///
- /// The path of the artifact to upload
+ /// Gets or sets a file, directory or wildcard pattern that describes what to upload. Required.
///
- public string? Path { get; set; }
+ public required string Path { get; set; }
+
+ ///
+ /// Gets or sets the desired behavior if no files are found using the provided path. Optional. Default is 'warn'.
+ ///
+ public string? IfNoFilesFound { get; set; }
+
+ ///
+ /// Gets or sets the duration after which artifact will expire in days. Optional. Defaults to repository settings.
+ ///
+ public int? RetentionDays { get; set; }
+
+ ///
+ /// Gets or sets the level of compression for Zlib to be applied to the artifact archive. Optional. Default is '6'.
+ ///
+ public int? CompressionLevel { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether an artifact with a matching name will be deleted before a new one is uploaded. Optional. Default is 'false'.
+ ///
+ public bool? Overwrite { get; set; }
///
public override void Write(CustomFileWriter writer)
diff --git a/src/Nuke/GithubActions/UsingStep.cs b/src/Nuke/GithubActions/UsingStep.cs
index d52c3c03..bdf13e0d 100644
--- a/src/Nuke/GithubActions/UsingStep.cs
+++ b/src/Nuke/GithubActions/UsingStep.cs
@@ -14,9 +14,7 @@ public class UsingStep : BaseGitHubActionsStep
/// The constructor with the display name
///
///
- public UsingStep(string name) : base(name)
- {
- }
+ public UsingStep(string name) : base(name) { }
///
/// The action to use.
@@ -34,20 +32,16 @@ public UsingStep(string name) : base(name)
///
protected void WithProperties(Func transformName)
{
- foreach (var property in GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public)
- .Where(z => z.CanRead && z.CanWrite && z.DeclaringType == GetType()))
+ foreach (var property in GetType()
+ .GetProperties(BindingFlags.Instance | BindingFlags.Public)
+ .Where(z => z.CanRead && z.CanWrite && z.DeclaringType == GetType()))
{
var value = property.GetValue(this);
if (value == null) continue;
- With?.Add(
- transformName(property.Name), value switch
- {
- null => string.Empty,
- bool b => b.ToString().ToLowerInvariant(),
- string s => s,
- _ => value.ToString() ?? ""
- }
+ With.TryAdd(
+ transformName(property.Name),
+ value switch { null => string.Empty, bool b => b.ToString().ToLowerInvariant(), string s => s, _ => value.ToString() ?? "", }
);
}
}
@@ -64,4 +58,4 @@ public override void Write(CustomFileWriter writer)
writer.WriteKeyValues("with", With);
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Nuke/PublicAPI.Shipped.txt b/src/Nuke/PublicAPI.Shipped.txt
index d06bc0bf..79d71c99 100644
--- a/src/Nuke/PublicAPI.Shipped.txt
+++ b/src/Nuke/PublicAPI.Shipped.txt
@@ -215,10 +215,20 @@ Rocket.Surgery.Nuke.GithubActions.CheckoutStep.Token.set -> void
Rocket.Surgery.Nuke.GithubActions.CustomFileWriterExtensions
Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet
Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.DownloadArtifactSet(string! name) -> void
+Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.GithubToken.get -> string?
+Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.GithubToken.set -> void
+Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.MergeMultiple.get -> bool?
+Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.MergeMultiple.set -> void
Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.Name.get -> string?
Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.Name.set -> void
Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.Path.get -> string?
Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.Path.set -> void
+Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.Pattern.get -> string?
+Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.Pattern.set -> void
+Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.Repository.get -> string?
+Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.Repository.set -> void
+Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.RunId.get -> string?
+Rocket.Surgery.Nuke.GithubActions.DownloadArtifactSet.RunId.set -> void
Rocket.Surgery.Nuke.GithubActions.GithubActionCondition
Rocket.Surgery.Nuke.GithubActions.GithubActionCondition.Condition.get -> string?
Rocket.Surgery.Nuke.GithubActions.GithubActionCondition.GithubActionCondition(string! condition) -> void
@@ -615,10 +625,18 @@ Rocket.Surgery.Nuke.GithubActions.TriggerValueAttribute.Description.set -> void
Rocket.Surgery.Nuke.GithubActions.TriggerValueAttribute.Name.get -> string!
Rocket.Surgery.Nuke.GithubActions.TriggerValueAttribute.TriggerValueAttribute(string! name) -> void
Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep
-Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.Name.get -> string?
+Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.CompressionLevel.get -> int?
+Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.CompressionLevel.set -> void
+Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.IfNoFilesFound.get -> string?
+Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.IfNoFilesFound.set -> void
+Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.Name.get -> string!
Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.Name.set -> void
-Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.Path.get -> string?
+Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.Overwrite.get -> bool?
+Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.Overwrite.set -> void
+Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.Path.get -> string!
Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.Path.set -> void
+Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.RetentionDays.get -> int?
+Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.RetentionDays.set -> void
Rocket.Surgery.Nuke.GithubActions.UploadArtifactStep.UploadArtifactStep(string! name) -> void
Rocket.Surgery.Nuke.GithubActions.UsingStep
Rocket.Surgery.Nuke.GithubActions.UsingStep.Uses.get -> string?
@@ -797,6 +815,7 @@ Rocket.Surgery.Nuke.Readme.References.References() -> void
Rocket.Surgery.Nuke.Readme.Sections
Rocket.Surgery.Nuke.Readme.Sections.Add(Rocket.Surgery.Nuke.Readme.IReadmeSection! section) -> Rocket.Surgery.Nuke.Readme.Sections!
Rocket.Surgery.Nuke.Readme.Sections.Sections() -> void
+Rocket.Surgery.Nuke.Settings
Rocket.Surgery.Nuke.SolutionExtensions
Rocket.Surgery.Nuke.SolutionUpdaterConfigurationAttribute
Rocket.Surgery.Nuke.SolutionUpdaterConfigurationAttribute.AdditionalConfigFolderFilePatterns.get -> string![]!
@@ -909,6 +928,8 @@ static Rocket.Surgery.Nuke.GitVersionFunctions.FullSemanticVersion(this Nuke.Com
static Rocket.Surgery.Nuke.GitVersionFunctions.MajorMinorPatch(this Nuke.Common.Tools.GitVersion.GitVersion? gitVersion) -> string!
static Rocket.Surgery.Nuke.GitVersionFunctions.PackageVersion(this Nuke.Common.Tools.GitVersion.GitVersion? gitVersion) -> string!
static Rocket.Surgery.Nuke.Helpers.IsDotnetToolInstalled(string! nugetPackageName) -> bool
+static Rocket.Surgery.Nuke.Settings.DefaultGithubJobName.get -> string!
+static Rocket.Surgery.Nuke.Settings.DefaultGithubJobName.set -> void
static Rocket.Surgery.Nuke.SolutionExtensions.GetTestProjects(this Nuke.Common.ProjectModel.Solution! solution) -> System.Collections.Generic.IEnumerable!
static Rocket.Surgery.Nuke.SolutionExtensions.WherePackable(this Nuke.Common.ProjectModel.Solution! solution) -> System.Collections.Generic.IEnumerable!
static Rocket.Surgery.Nuke.StringExtensions.RemoveAlphaCharacters(this string! input) -> string!
diff --git a/src/Nuke/Rocket.Surgery.Nuke.csproj b/src/Nuke/Rocket.Surgery.Nuke.csproj
index 1678ef42..575e68a4 100644
--- a/src/Nuke/Rocket.Surgery.Nuke.csproj
+++ b/src/Nuke/Rocket.Surgery.Nuke.csproj
@@ -12,6 +12,7 @@
+
diff --git a/src/Nuke/Settings.cs b/src/Nuke/Settings.cs
new file mode 100644
index 00000000..a4dc41a1
--- /dev/null
+++ b/src/Nuke/Settings.cs
@@ -0,0 +1,12 @@
+namespace Rocket.Surgery.Nuke;
+
+///
+/// The settings for the nuke build
+///
+public static class Settings
+{
+ ///
+ /// The default github job name, so that it can be overridden
+ ///
+ public static string DefaultGithubJobName { get; set; } = "build";
+}
\ No newline at end of file