-
Notifications
You must be signed in to change notification settings - Fork 29
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
Showing
8 changed files
with
131 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Nuke.Common; | ||
using Nuke.Common.IO; | ||
using Nuke.Common.Tools.DotNet; | ||
|
||
partial class Build | ||
{ | ||
AbsolutePath OutputPkgDirectory => OutputDirectory / "packages"; | ||
|
||
Target Pack => d => d | ||
.Produces(OutputPkgDirectory / "*.zip") | ||
.Executes(() => | ||
{ | ||
OutputPkgDirectory.CreateOrCleanDirectory(); | ||
return DotNetTasks.DotNetPack(s => s | ||
.SetConfiguration(Configuration) | ||
.SetOutputDirectory(OutputPkgDirectory)); | ||
}); | ||
} |
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,80 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using JetBrains.Annotations; | ||
using Nuke.Common; | ||
using Nuke.Common.IO; | ||
using Nuke.Common.ProjectModel; | ||
using Nuke.Common.Tools.DotNet; | ||
using Nuke.Common.Tools.EntityFramework; | ||
|
||
partial class Build | ||
{ | ||
AbsolutePath OutputExeDirectory => OutputDirectory / "dist"; | ||
|
||
[CanBeNull] SolutionFolder SourceSolutionFolder => Solution?.GetSolutionFolder("src"); | ||
[CanBeNull] SolutionFolder SourceAppSolutionFolder => SourceSolutionFolder?.GetSolutionFolder("app"); | ||
[CanBeNull] SolutionFolder SourcePluginSolutionFolder => SourceSolutionFolder?.GetSolutionFolder("plugin"); | ||
[CanBeNull] SolutionFolder SourceCommonSolutionFolder => SourceSolutionFolder?.GetSolutionFolder("common"); | ||
|
||
IEnumerable<string> Runtimes => new[] | ||
{ | ||
"win-x64", | ||
"win-arm64", | ||
"linux-x64", | ||
"linux-arm64", | ||
"osx-arm64" | ||
}; | ||
|
||
Target Publish => d => d | ||
.Produces(OutputExeDirectory / "*.zip") | ||
.Executes(() => | ||
{ | ||
OutputExeDirectory.CreateOrCleanDirectory(); | ||
|
||
if (SourceAppSolutionFolder?.Projects == null) return; | ||
|
||
foreach (var runtime in Runtimes) | ||
{ | ||
var outputRuntimeDirectory = OutputExeDirectory / $"{runtime}"; | ||
var outputRuntimePluginsDirectory = outputRuntimeDirectory / "plugins"; | ||
|
||
outputRuntimeDirectory.CreateOrCleanDirectory(); | ||
|
||
foreach (var project in SourceAppSolutionFolder.Projects) | ||
{ | ||
DotNetTasks.DotNetPublish(s => s | ||
.SetProject(project) | ||
.SetConfiguration(Configuration) | ||
.SetRuntime(runtime) | ||
.SetPublishSingleFile(true) | ||
.SetSelfContained(true) | ||
.SetOutput(outputRuntimeDirectory)); | ||
} | ||
|
||
if (SourceCommonSolutionFolder?.Projects != null) | ||
foreach (var project in SourceCommonSolutionFolder.Projects) | ||
{ | ||
if (project.Name.StartsWith("Edelstein.Common.Database.")) | ||
{ | ||
var provider = project.Name.Split(".").Last().ToLower(); | ||
|
||
EntityFrameworkTasks.EntityFrameworkMigrationsScript(s => s | ||
.SetProject(project) | ||
.SetConfiguration(Configuration) | ||
.SetOutput(outputRuntimeDirectory / $"db-migrate-{provider}.sql")); | ||
} | ||
} | ||
|
||
if (SourcePluginSolutionFolder?.Projects != null) | ||
foreach (var project in SourcePluginSolutionFolder.Projects) | ||
{ | ||
DotNetTasks.DotNetPublish(s => s | ||
.SetProject(project) | ||
.SetConfiguration(Configuration) | ||
.SetOutput(outputRuntimePluginsDirectory / project.Name)); | ||
} | ||
|
||
outputRuntimeDirectory.ZipTo(OutputExeDirectory / $"{outputRuntimeDirectory.Name}.zip"); | ||
} | ||
}); | ||
} |
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,9 @@ | ||
using Nuke.Common.CI.GitHubActions; | ||
|
||
[GitHubActions( | ||
"Build", | ||
GitHubActionsImage.UbuntuLatest, | ||
On = new[] { GitHubActionsTrigger.Push }, | ||
InvokedTargets = new[] { nameof(Compile) } | ||
)] | ||
partial class Build; |
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