|
|
|
@ -240,71 +240,6 @@ Task("Create-NuGet-Packages-Impl") |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
Task("Publish-MyGet-Impl") |
|
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => !data.Parameters.IsLocalBuild) |
|
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => !data.Parameters.IsPullRequest) |
|
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => data.Parameters.IsMainRepo) |
|
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => data.Parameters.IsMasterBranch) |
|
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => data.Parameters.IsMyGetRelease) |
|
|
|
.Does<AvaloniaBuildData>(data => |
|
|
|
{ |
|
|
|
var apiKey = EnvironmentVariable("MYGET_API_KEY"); |
|
|
|
if(string.IsNullOrEmpty(apiKey)) |
|
|
|
{ |
|
|
|
throw new InvalidOperationException("Could not resolve MyGet API key."); |
|
|
|
} |
|
|
|
|
|
|
|
var apiUrl = EnvironmentVariable("MYGET_API_URL"); |
|
|
|
if(string.IsNullOrEmpty(apiUrl)) |
|
|
|
{ |
|
|
|
throw new InvalidOperationException("Could not resolve MyGet API url."); |
|
|
|
} |
|
|
|
|
|
|
|
foreach(var nupkg in data.Packages.NugetPackages) |
|
|
|
{ |
|
|
|
NuGetPush(nupkg, new NuGetPushSettings { |
|
|
|
Source = apiUrl, |
|
|
|
ApiKey = apiKey |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
.OnError(exception => |
|
|
|
{ |
|
|
|
Information("Publish-MyGet Task failed, but continuing with next Task..."); |
|
|
|
}); |
|
|
|
|
|
|
|
Task("Publish-NuGet-Impl") |
|
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => !data.Parameters.IsLocalBuild) |
|
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => !data.Parameters.IsPullRequest) |
|
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => data.Parameters.IsMainRepo) |
|
|
|
.WithCriteria<AvaloniaBuildData>((context, data) => data.Parameters.IsNuGetRelease) |
|
|
|
.Does<AvaloniaBuildData>(data => |
|
|
|
{ |
|
|
|
var apiKey = EnvironmentVariable("NUGET_API_KEY"); |
|
|
|
if(string.IsNullOrEmpty(apiKey)) |
|
|
|
{ |
|
|
|
throw new InvalidOperationException("Could not resolve NuGet API key."); |
|
|
|
} |
|
|
|
|
|
|
|
var apiUrl = EnvironmentVariable("NUGET_API_URL"); |
|
|
|
if(string.IsNullOrEmpty(apiUrl)) |
|
|
|
{ |
|
|
|
throw new InvalidOperationException("Could not resolve NuGet API url."); |
|
|
|
} |
|
|
|
|
|
|
|
foreach(var nupkg in data.Packages.NugetPackages) |
|
|
|
{ |
|
|
|
NuGetPush(nupkg, new NuGetPushSettings { |
|
|
|
ApiKey = apiKey, |
|
|
|
Source = apiUrl |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
.OnError(exception => |
|
|
|
{ |
|
|
|
Information("Publish-NuGet Task failed, but continuing with next Task..."); |
|
|
|
}); |
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////// |
|
|
|
// TARGETS |
|
|
|
/////////////////////////////////////////////////////////////////////////////// |
|
|
|
|