mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-21 09:49:32 +00:00
26 lines
714 B
C#
26 lines
714 B
C#
using Cake.Common.Tools.DotNet;
|
|
using Cake.Common.Tools.DotNet.NuGet.Push;
|
|
using Cake.Frosting;
|
|
|
|
namespace BuildScripts;
|
|
|
|
[TaskName(nameof(DeployToGitHubTask))]
|
|
public sealed class DeployToGitHubTask : FrostingTask<BuildContext>
|
|
{
|
|
public override bool ShouldRun(BuildContext context)
|
|
{
|
|
return context.IsRunningOnGitHubActions;
|
|
}
|
|
|
|
public override void Run(BuildContext context)
|
|
{
|
|
DotNetNuGetPushSettings pushSettings = new DotNetNuGetPushSettings()
|
|
{
|
|
Source = $"https://nuget.pkg.github.com/{context.RepositoryOwner}/index.json",
|
|
ApiKey = context.GitHubToken
|
|
};
|
|
|
|
context.DotNetNuGetPush("artifacts/*.nupkg", pushSettings);
|
|
}
|
|
}
|