-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub actions/setup-dotnet support
- Loading branch information
Showing
4 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
source/Nuke.Common/CI/GitHubActions/Configuration/GitHubActionsSetupDotNetStep.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2025 Maintainers of NUKE. | ||
// Distributed under the MIT License. | ||
// https://github.com/nuke-build/nuke/blob/master/LICENSE | ||
|
||
using JetBrains.Annotations; | ||
using Nuke.Common.Utilities; | ||
|
||
namespace Nuke.Common.CI.GitHubActions.Configuration; | ||
|
||
// https://github.com/actions/setup-dotnet | ||
[PublicAPI] | ||
public class GitHubActionsSetupDotNetStep : GitHubActionsStep | ||
{ | ||
public string[] Versions { get; set; } | ||
|
||
public override void Write(CustomFileWriter writer) | ||
{ | ||
writer.WriteLine("- uses: actions/setup-dotnet@v4"); | ||
|
||
using (writer.Indent()) | ||
{ | ||
writer.WriteLine("with:"); | ||
using (writer.Indent()) | ||
{ | ||
writer.WriteLine("dotnet-version: |"); | ||
using (writer.Indent()) | ||
{ | ||
foreach (var version in Versions) | ||
{ | ||
writer.WriteLine(version); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters