Skip to content

Commit

Permalink
Add Minver versioning to artifact publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaioru committed Aug 18, 2024
1 parent 7092a8b commit 79b7854
Show file tree
Hide file tree
Showing 9 changed files with 2,624 additions and 5 deletions.
9 changes: 7 additions & 2 deletions build/Build.Artifacts.Publish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
using Nuke.Common;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.EntityFramework;
using Nuke.Common.Tools.MinVer;

partial class Build
{
Expand Down Expand Up @@ -33,10 +35,13 @@ partial class Build

if (SourceAppSolutionFolder?.Projects == null) return;

var version = MinVerTasks.MinVer("-m 1.0 -p preview -v e").First().Text;

foreach (var runtime in Runtimes)
{
var outputRuntimeDirectory = OutputExeDirectory / $"{runtime}";
var outputRuntimeDirectory = OutputExeDirectory / $"{runtime}-{version}";
var outputRuntimePluginsDirectory = outputRuntimeDirectory / "plugins";
var outputRuntimeMigrationsDirectory = outputRuntimeDirectory / "migrations";

outputRuntimeDirectory.CreateOrCleanDirectory();

Expand All @@ -61,7 +66,7 @@ partial class Build
EntityFrameworkTasks.EntityFrameworkMigrationsScript(s => s
.SetProject(project)
.SetConfiguration(Configuration)
.SetOutput(outputRuntimeDirectory / $"db-migrate-{provider}.sql"));
.SetOutput(outputRuntimeMigrationsDirectory / $"migrate-{provider}.sql"));
}
}

Expand Down
4 changes: 3 additions & 1 deletion build/Build.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using JetBrains.Annotations;
using System.Linq;
using Nuke.Common;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.MinVer;

partial class Build : NukeBuild
{
Expand Down
4 changes: 4 additions & 0 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@
<PackageReference Include="Nuke.Common" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<PackageDownload Include="minver-cli" Version="[5.0.0]" />
</ItemGroup>

</Project>
Loading

0 comments on commit 79b7854

Please sign in to comment.