✅ [Nuget] How to find the latest version of a package?
In GitHub action workflow, I need to find the latest stable version of this package:https://www.nuget.org/packages/microsoft.web.webview2
First, I found this endpoint (https://api.nuget.org/v3-flatcontainer/Microsoft.Web.WebView2/index.json) that list all the version, but like you can see, it also includ the pre-release version, so I cannot use it.
I also found this endpoint (https://api.nuget.org/v3/registration5-gz-semver2/microsoft.web.webview2/index.json) which give more info about each version, but it doesn't tell me if it is a prerelease or not
So, is there a endpoint that can told me if X version is a prerelease version?
17 Replies
Am I misunderstanding something or is that not this?
Yeah, I wonder how you can possibly tell which one is a prerelease...
if you're using visual studio, then there's a tick box for 'include prerelease packages' -i'd assume API wise they're just tags, at the bottom of your screen shot
(the versions also have -prerelease
No, because some other package can contain -alpha, -beta, etc, so it isn't a good way :/
Yes it is
Ah, so it's not about this specific package, but rather any package
Exactly, it was only a example
In that case, the easiest way would be to just regex the version string. If it contains any letters, chances are it's some
-beta
or -prerelease
or something
Not... completely reliable, but stupid easyUnknown User•4w ago
Message Not Public
Sign In & Join Server To View
Pre-release versions in NuGet packages
Guidance for building pre-release packages
Yeah, just saw it in the docs
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
Would even work for calendar versions and anything else. The way nuget determines prerelease is that dash anyway
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
So even if it was
2023.5
then 2023.5-ungabunga
would be the prereleaseUnknown User•4w ago
Message Not Public
Sign In & Join Server To View
Thanks 🙂
!close
Closed!