KhronosGroup / glTF-CSharp-Loader

C# Reference Loader for glTF
Other
213 stars 60 forks source link

Suggestion for versioning when releasing packages. #11

Open vpenades opened 6 years ago

vpenades commented 6 years ago

Right now, the project is set to version 1.0.0, even if that particular version has already been released.

I would like to propose this procedure for releasing final and pre-release packages:

  1. Immediately before releasing a final package, set the version to the appropiate value, let's say "1.1.0"
  2. Compile and do the release.
  3. Immediately after the release, change the version to "1.2.0-Alpha" and commit that change, so this version will stay in place for all subsequent commits.
  4. When a new release is ready, repeat from step 1

It could be interesting to upload pre-release packages too...

bghgary commented 6 years ago

I'm not sure what is typically done for open source NuGet packages. What you're saying sounds reasonable to me for now. I'm hoping we can automate this in the build somehow eventually.

vpenades commented 6 years ago

As far as I know, nuget packages use Semantic Versioning, which is horribly complicated to make fully automated, because it involves detecting breaking API changes with the previous versions.

At some point, most projects I've seen have some sort of human involvement when choosing major version.

Given that final (major) versions are released from time to time, and what you would typically release quite often is pre-release packages, I've came to this format for my packages:

1.0.0-alpha-170913-202630

Where 1.0.0 is set manually, and 170913-202630 is the UTC DateTime of the compilation, set automatically.

So every time you compile, you get a new "alpha" package in the directory, so it's very easy to just upload a new prerelease.

More info on package versioning here.

If you like this versioning model, I could edit the csproj to add this automatic versioning feature.

bghgary commented 6 years ago

My opinion is to go with your first proposal for now. If we find that we are making more frequent changes/releases, then we can consider other options.

bghgary commented 6 years ago

I've uploaded a prelease version with your recent changes: https://www.nuget.org/packages/glTF2Loader/1.1.0-alpha

Will see how it goes.

vpenades commented 6 years ago

Thanks!, I'll give it a try 😄

thomashilke commented 1 year ago

IMO, the most convenient way to handle this is to rely on GitVersion, and github actions to automate builds and publishing nugets on the nuget.org repository. I set this up on my own repo which you can use as a reference if you like it: https://github.com/thomashilke/KineticConvolution. The versioning configuration is defined by the file GitVersion.yml, and the github action is defined in .github/workflows/build-deploy.yml.

With this particular setup, builds and build validations are automatically triggered for commits on master and on PR branches, and creating a release from github interface trig a the action to automatically push the nuget on nuget.org.

bghgary commented 1 year ago

@thomashilke That seems reasonable, but it would be great if someone wanted to contribute a PR to make this happen.