Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version when packing #202

Merged
merged 4 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/cd_standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,13 @@ jobs:
shell: pwsh
run: |
dotnet nuget add source "${{ github.workspace }}/nupkg" --name LocalVersion
dotnet new --install "${{ github.workspace }}/nupkg/OpenDDSharp.Templates.${{ env.GitVersion_Major }}.${{ env.GitVersion_Minor }}.${{ env.GitVersion_Patch }}.${{ env.GitVersion_WeightedPreReleaseNumber }}${{ env.GitVersion_PreReleaseLabelWithDash }}.nupkg"

$version = "${{ env.GitVersion_Major }}.${{ env.GitVersion_Minor }}.${{ env.GitVersion_Patch }}"
if (-Not ([string]::IsNullOrEmpty("${{ env.GitVersion_PreReleaseLabelWithDash }}"))) {
$version = "$version${{ env.GitVersion_PreReleaseLabelWithDash }}${{ env.GitVersion_WeightedPreReleaseNumber }}"
}

dotnet new --install "${{ github.workspace }}/nupkg/OpenDDSharp.Templates.$version.nupkg"
New-Item -Path "." -Name "Test" -ItemType "directory"
cd Test
dotnet new openddsharp-idl-project
Expand Down
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
Loading