-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.cake
51 lines (40 loc) · 1.6 KB
/
build.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
42
43
44
45
46
47
48
49
50
51
var target = Argument("target", "Build");
var configuration = Argument("configuration", "Release");
Task("Build").Does(() => {
var settings = new DotNetCoreBuildSettings()
{
Configuration = "Release",
Sources = new List<string>() {"https://api.nuget.org/v3/index.json","https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-6f411658/nuget/v3/index.json", "https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-1ec2e17f/nuget/v3/index.json"}
};
DotNetCoreBuild("src/TinyMvvm.Maui/TinyMvvm.Maui.csproj", settings);
});
Task("Pack").IsDependentOn("Build").Does(() =>
{
var version = EnvironmentVariable<string>("GITHUB_REF", "").Split("/").Last();
var settings = new DotNetCorePackSettings()
{
IncludeSymbols = true,
ArgumentCustomization = args=>args.Append($"-p:PackageVersion={version}"),
Configuration = "Release",
OutputDirectory = ".packages"
};
DotNetCorePack("src/TinyMvvm.Maui/TinyMvvm.Maui.csproj", settings);
});
Task("Publish").IsDependentOn("Pack").Does(() =>{
var apiKey = EnvironmentVariable<string>("NUGETKEY", "");
var settings = new DotNetCoreNuGetPushSettings
{
Source = "https://www.nuget.org/api/v2/package/",
ApiKey = apiKey,
IgnoreSymbols = false
};
DotNetCoreNuGetPush(".packages/*.nupkg", settings);
var symbolSettings = new DotNetCoreNuGetPushSettings
{
Source = "https://www.nuget.org/api/v2/symbolpackage/",
ApiKey = apiKey,
IgnoreSymbols = false
};
DotNetCoreNuGetPush(".packages/*.snupkg", symbolSettings);
});
RunTarget(target);