Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Support Semantic Versioning #21

Closed
AdmiringWorm opened this issue Sep 3, 2016 · 11 comments
Closed

Support Semantic Versioning #21

AdmiringWorm opened this issue Sep 3, 2016 · 11 comments

Comments

@AdmiringWorm
Copy link
Contributor

Please add support for semantic versioning.

I understand this would require some rewrite to compare (alpha,beta,rc etc...)

This woul be a great help in automatically building packages which hasn't received stable state yet,
especially on packages where the stable version is broken while the pre-release isn't.

@majkinetor
Copy link
Owner

Could you clarify it a bit by providing a concrete example ?

Package version follows the vendor version, the only thing AU does now is choco fix notation when update is forced.

@AdmiringWorm
Copy link
Contributor Author

What I mean is support versioning like 1.10.20606.1-rc2.
If I were to try execute au using this version.
It would just fail because of the regex used to parse versions, and because it isn't supported by System.Version of course.

@majkinetor majkinetor added this to the next milestone Sep 3, 2016
@majkinetor
Copy link
Owner

I didn't think this is actually supported by chocolatey.

If it is supported by choco it should be supported by AU. I set this to lower priority tho (it doesn't seem many packages use this?). If this is a problem for you, please feel free to PR.

Thanks for report.

@majkinetor
Copy link
Owner

Reference: https://docs.nuget.org/create/versioning

@AdmiringWorm
Copy link
Contributor Author

it is supported by choco see https://chocolatey.org/packages/NuGet.CommandLine/3.4.4-rtm-final which uses the -rtm-final suffix, it is true that there isn't many packages that use this.
But that could also be because there wasn't much support for it in Chocolatey Automatic Package Updater (which I believe most still use) until quite recently.

Also the reference document on nuget you linked to have a section for semver versioning:
https://docs.nuget.org/create/versioning#user-content-really-brief-introduction-to-semver.

At the moment it isn't that much of a problem for me.
I only maintain one package which releases rc builds so I can manage with manually doing those.
Just thought it would be a nice addition.

I don't have a firm understanding of PowerShell yet, so a PR from me in the near future is unlikely.

@majkinetor majkinetor removed this from the next milestone Sep 16, 2016
@majkinetor
Copy link
Owner

Implemented. You can get the 7z artifact of the latest build to test it out before release if you want.

Example tests:

https://github.com/majkinetor/au/blob/master/tests/Update-Package.Tests.ps1#L110-L128

@AdmiringWorm
Copy link
Contributor Author

Thanks alot for implementing this, I'll check it out. Just got to figure out why the Push-Package function is never called in my script first.

@AdmiringWorm
Copy link
Contributor Author

So I finally had a chance to take a look at this, and so far it seems to work great. Thanks again

@ferventcoder
Copy link

Sweet!

@majkinetor
Copy link
Owner

[SemanticVersion] added to PoSh 6:

Describe "SemanticVersion api tests" -Tags 'CI' {
5       Context "constructing valid versions" {
6           It "string argument constructor" {
7               $v = [SemanticVersion]::new("1.2.3-alpha")

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants