mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-15 15:09:29 +00:00
Create DeployToNuGetTask
This commit is contained in:
committed by
GitHub
parent
9d73597323
commit
c6e472338d
@@ -0,0 +1,27 @@
|
||||
using Cake.Common.Tools.DotNet;
|
||||
using Cake.Common.Tools.DotNet.NuGet.Push;
|
||||
using Cake.Frosting;
|
||||
|
||||
namespace BuildScripts;
|
||||
|
||||
[TaskName(nameof(DeployToNuGetTask))]
|
||||
public sealed class DeployToNuGetTask : FrostingTask<BuildContext>
|
||||
{
|
||||
public override bool ShouldRun(BuildContext context)
|
||||
{
|
||||
return context.IsRunningOnGitHubActions &&
|
||||
context.IsTag &&
|
||||
context.RepositoryOwner == "craftworksgames";
|
||||
}
|
||||
|
||||
public override void Run(BuildContext context)
|
||||
{
|
||||
DotNetNuGetPushSettings pushSettings = new DotNetNuGetPushSettings()
|
||||
{
|
||||
Source = $"https://api.nuget.org/v3/index.json",
|
||||
ApiKey = context.NuGetAccessToken
|
||||
};
|
||||
|
||||
context.DotNetNuGetPush("artifacts/*.nupkg", pushSettings);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user