-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathUploadPackagesToLocalNuGetModule.cs
More file actions
30 lines (27 loc) · 1.08 KB
/
UploadPackagesToLocalNuGetModule.cs
File metadata and controls
30 lines (27 loc) · 1.08 KB
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
using ModularPipelines.Attributes;
using ModularPipelines.Build.Helpers;
using ModularPipelines.Context;
using ModularPipelines.Extensions;
using ModularPipelines.FileSystem;
using ModularPipelines.Models;
using ModularPipelines.Modules;
using File = ModularPipelines.FileSystem.File;
namespace ModularPipelines.Build.Modules.LocalMachine;
[DependsOn<AddLocalNugetSourceModule>]
[DependsOn<PackagePathsParserModule>]
[DependsOn<CreateLocalNugetFolderModule>]
[RunOnLinuxOnly]
public class UploadPackagesToLocalNuGetModule : Module<CommandResult[]>
{
public override async Task<CommandResult[]?> ExecuteAsync(IModuleContext context, CancellationToken cancellationToken)
{
var localRepoLocation = context.GetModule<CreateLocalNugetFolderModule, Folder>();
var packagePaths = context.GetModule<PackagePathsParserModule, List<File>>();
return await NugetUploadHelper.UploadPackagesAsync(
context,
packagePaths.Value!,
source: localRepoLocation.Value.AssertExists()!.Path,
apiKey: null,
cancellationToken);
}
}