-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e54741
commit 0c0cb1b
Showing
29 changed files
with
191 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// ReSharper disable ClassNeverInstantiated.Global | ||
|
||
namespace Build; | ||
|
||
internal class DeployTarget( | ||
Settings settings, | ||
Commands commands, | ||
[Tag(typeof(PackTarget))] ITarget<IReadOnlyCollection<Package>> packTarget) | ||
: IInitializable, ITarget<int> | ||
{ | ||
public Task InitializeAsync() => commands.Register( | ||
this, | ||
"Deploys packages", | ||
"deploy", | ||
"dp"); | ||
|
||
public async Task<int> RunAsync(CancellationToken cancellationToken) | ||
{ | ||
if (string.IsNullOrWhiteSpace(settings.NuGetKey)) | ||
{ | ||
Warning("The NuGet key was not specified, the packages will not be pushed."); | ||
return 0; | ||
} | ||
|
||
var packages = await packTarget.RunAsync(cancellationToken); | ||
foreach (var package in packages.Where(i => i.Deploy)) | ||
{ | ||
new DotNetNuGetPush() | ||
.WithPackage(package.Path) | ||
.WithSources("https://api.nuget.org/v3/index.json") | ||
.WithApiKey(settings.NuGetKey) | ||
.Build() | ||
.Succeed(); | ||
} | ||
|
||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Build.Targets; | ||
namespace Build; | ||
|
||
internal interface IInitializable | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Build.Targets; | ||
namespace Build; | ||
|
||
internal interface ITarget<T> | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Build.Targets; | ||
namespace Build; | ||
|
||
internal record Library( | ||
string Name, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace Build.Targets; | ||
namespace Build; | ||
|
||
internal record Package(string Path, bool Deploy); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.