Skip to content

Commit 3ed4e81

Browse files
Use Cake.Sdk
1 parent fd3f401 commit 3ed4e81

4 files changed

Lines changed: 15 additions & 8 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
shell: bash
2424
run: |
2525
dotnet tool restore
26-
dotnet cake
26+
dotnet make

.github/workflows/publish.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,4 @@ jobs:
3434
shell: bash
3535
run: |
3636
dotnet tool restore
37-
dotnet cake --target="publish" \
38-
--nuget-key="${{secrets.NUGET_API_KEY}}" \
39-
--github-key="${{secrets.GITHUB_TOKEN}}"
37+
dotnet make publish --nuget-key="${{secrets.NUGET_API_KEY}}"

build.cake renamed to build.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#:sdk Cake.Sdk@6.2.0
2+
13
var target = Argument("target", "Default");
24
var configuration = Argument("configuration", "Release");
35

@@ -47,12 +49,11 @@
4749
.IsDependentOn("Package")
4850
.Does(context =>
4951
{
50-
var apiKey = Argument<string>("nuget-key", null);
52+
var apiKey = Argument<string?>("nuget-key", null);
5153
if(string.IsNullOrWhiteSpace(apiKey)) {
5254
throw new CakeException("No NuGet API key was provided.");
5355
}
5456

55-
// Publish to GitHub Packages
5657
foreach(var file in context.GetFiles("./.artifacts/*.nupkg"))
5758
{
5859
context.Information("Publishing {0}...", file.GetFilename().FullPath);
@@ -76,4 +77,4 @@
7677
////////////////////////////////////////////////////////////////
7778
// Execution
7879

79-
RunTarget(target)
80+
RunTarget(target);

dotnet-tools.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@
66
"version": "5.1.0",
77
"commands": [
88
"dotnet-cake"
9-
]
9+
],
10+
"rollForward": false
11+
},
12+
"make": {
13+
"version": "0.11.0",
14+
"commands": [
15+
"dotnet-make"
16+
],
17+
"rollForward": false
1018
}
1119
}
1220
}

0 commit comments

Comments
 (0)