-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.cake
41 lines (38 loc) · 1.2 KB
/
publish.cake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var target = Argument("target", "Default");
var GITHUB_TOKEN = Argument("GITHUB_TOKEN", "");
var NUGET_API_KEY = Argument("NUGET_API_KEY", "");
Task("Github")
.Does(context => {
if (BuildSystem.GitHubActions.IsRunningOnGitHubActions)
{
foreach(var file in GetFiles("./artifacts/nuget-packages/*.nupkg"))
{
Information("Publishing {0}...", file.GetFilename().FullPath);
DotNetNuGetPush(file, new DotNetNuGetPushSettings {
ApiKey = GITHUB_TOKEN,
Source = "https://nuget.pkg.github.com/nostrfi/index.json",
SkipDuplicate = true
});
}
}
});
Task("Nuget")
.IsDependentOn("Github")
.Does(context => {
if (BuildSystem.GitHubActions.IsRunningOnGitHubActions)
{
foreach(var file in GetFiles("./artifacts/nuget-packages/*.nupkg"))
{
Information("Publishing {0}...", file.GetFilename().FullPath);
DotNetNuGetPush(file, new DotNetNuGetPushSettings {
ApiKey = NUGET_API_KEY,
Source = "https://api.nuget.org/v3/index.json",
SkipDuplicate = true
});
}
}
});
Task("Default")
.IsDependentOn("Github")
.IsDependentOn("Nuget");
RunTarget(target);