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

Leverage Nerdbank.GitVersioning to auto-increment version numbers #1212

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

tmilnthorp
Copy link
Collaborator

Leverage Nerdbank.GitVersioning to auto-increment version numbers

I need your help @angularsen with the NanoFramework items. Not sure if I did it right.

Also I suppose we may need to remove some files (build\bump-version-UnitsNet-minor.bat, etc.)?

@tmilnthorp tmilnthorp marked this pull request as draft February 23, 2023 18:33
@angularsen
Copy link
Owner

Didn't get to it this weekend, will ping back later.

@tmilnthorp
Copy link
Collaborator Author

I think if ADO was not doing a shallow checkout, this should work as-is.

@tmilnthorp tmilnthorp marked this pull request as ready for review February 26, 2023 20:49
Change `branchName` from `v{version}` to `releases/v{version}` to match existing branches.
Change `tagName` from `v{version}` to `UnitsNet/{version}` to match existing tags.
Matches docs, since the patch will be determined by CI
@tmilnthorp
Copy link
Collaborator Author

@angularsen are you able to edit the ADO build to do a full depth checkout? (Depth 0)

Copy link
Owner

@angularsen angularsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed some changes to match existing branch names and tag names.
Also some questions/thoughts below.

  1. How do we test this without pushing nugets? Should we create a new master branch to simulate how master would be and disable push to nuget.org on that branch?
  2. What is the procedure for bumping versions? It seems GitVersioning and their CLI tooling is aimed towards stabilizing releases on new branches, but in UnitsNet it is pretty much about bumping minor versions for every new unit and additive changes. I want to keep it simple, ideally having the CI build bump the minor version for me. Not sure if it can be configured that way, it seems patch version is what is supported for auto-versioning.

@@ -20,7 +20,6 @@

<!-- Assembly and msbuild properties -->
<PropertyGroup>
<AssemblyVersion>5.0.0.0</AssemblyVersion> <!-- Should reflect major part of Version -->
Copy link
Owner

@angularsen angularsen Mar 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making a mental note to verify that the assembly version is still 5.0.0.0 and not 5.5.0. If I recall correctly, this is important for those that rely on strong name signed assemblies to not have problems when upgrading.

@@ -5,9 +5,6 @@ if %errorlevel% neq 0 goto EXIT
call git pull --rebase --prune
if %errorlevel% neq 0 goto EXIT

call build\bump-version-UnitsNet-minor.bat
if %errorlevel% neq 0 goto EXIT

call git push --follow-tags --set-upstream
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the CI build would instead do the tagging now? Also, this whole file can probably be deleted.
https://github.com/dotnet/Nerdbank.GitVersioning/blob/main/doc/nbgv-cli.md#creating-a-version-tag

version.json Outdated
"enabled": true
}
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/dotnet/Nerdbank.GitVersioning/blob/main/doc/nbgv-cli.md#customizing-the-behaviour-of-tag

I'm not sure how to best handle UnitsNet vs JSON nugets. We currently bump the versions separately and tag them separately.

On one hand, it is useful to only bump JSON when it actually has any changes.
On the other hand, I want a simple setup that avoids mistakes like we had recently.
If they share version number, then I guess they can also share git tag.

I lean towards a single version for all UnitsNet packages - UnitsNet, Json and NanoFramework packages.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can create nested version.json files if we want to split it still, and set a nbgv path filter

@tmilnthorp
Copy link
Collaborator Author

How do we test this without pushing nugets? Should we create a new master branch to simulate how master would be and disable push to nuget.org on that branch?

  1. Make sure you have nbgv installed locally: dotnet tool install -g nbgv
  2. Checkout master locally and merge in this branch
  3. Run nbgv get-version
  4. git reset origin/master to reset local master

What is the procedure for bumping versions? It seems GitVersioning and their CLI tooling is aimed towards stabilizing releases on new branches, but in UnitsNet it is pretty much about bumping minor versions for every new unit and additive changes. I want to keep it simple, ideally having the CI build bump the minor version for me. Not sure if it can be configured that way, it seems patch version is what is supported for auto-versioning.

Hmmm indeed. Let me see if I can make it get the minor to increment

@stale
Copy link

stale bot commented Jun 18, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants