Skip to content

Commit

Permalink
Update version when packing
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmorato committed Oct 18, 2023
1 parent 3fbfa62 commit fd95863
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Build/OpenDDSharp.Build/Tasks/PackNuGet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ public class PackNuGet : FrostingTask<BuildContext>
/// <inheritdoc/>
public override void Run(BuildContext context)
{
var version = $"{context.MajorVersion}.{context.MinorVersion}.{context.PatchVersion}.{context.BuildNumber}{context.PreReleaseTag}";
var version = $"{context.MajorVersion}.{context.MinorVersion}.{context.PatchVersion}";
if (!string.IsNullOrWhiteSpace(context.PreReleaseTag))
{
version += $"-{context.PreReleaseTag}{context.BuildNumber}";
}

var solutionPath = Path.GetFullPath(BuildContext.OPENDDSHARP_SOLUTION_FOLDER);
var path = Path.Combine(solutionPath, "Sources", "OpenDDSharp", "OpenDDSharp.csproj");
Expand Down
6 changes: 5 additions & 1 deletion Build/OpenDDSharp.Build/Tasks/SetVersionNuspec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ public override void Run(BuildContext context)
{
context.Log.Information("Set version in NuSpec...");

var version = $"{context.MajorVersion}.{context.MinorVersion}.{context.PatchVersion}.{context.BuildNumber}{context.PreReleaseTag}";
var version = $"{context.MajorVersion}.{context.MinorVersion}.{context.PatchVersion}";
if (!string.IsNullOrWhiteSpace(context.PreReleaseTag))
{
version += $"-{context.PreReleaseTag}{context.BuildNumber}";
}

var path = context.MakeAbsolute(context.Directory(BuildContext.OPENDDSHARP_SOLUTION_FOLDER));

Expand Down
6 changes: 5 additions & 1 deletion Build/OpenDDSharp.Build/Tasks/SetVersionProjectTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ public override void Run(BuildContext context)
{
context.Log.Information("Set version in ProjectTemplate...");

var version = $"{context.MajorVersion}.{context.MinorVersion}.{context.PatchVersion}.{context.BuildNumber}{context.PreReleaseTag}";
var version = $"{context.MajorVersion}.{context.MinorVersion}.{context.PatchVersion}";
if (!string.IsNullOrWhiteSpace(context.PreReleaseTag))
{
version += $"-{context.PreReleaseTag}{context.BuildNumber}";
}

var path = context.MakeAbsolute(context.Directory(BuildContext.OPENDDSHARP_SOLUTION_FOLDER));

Expand Down
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next-version: "3.250.1"
next-version: "3.250.2"
mode: ContinuousDeployment
update-build-number: true
tag-prefix: '(release-)?[vV]'
Expand Down

0 comments on commit fd95863

Please sign in to comment.