C
C#20h ago
moi15moi

✅ [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
greyfox
greyfox20h ago
Am I misunderstanding something or is that not this?
No description
Angius
Angius20h ago
Yeah, I wonder how you can possibly tell which one is a prerelease...
No description
SquireZ
SquireZ20h ago
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
moi15moi
moi15moiOP20h ago
No, because some other package can contain -alpha, -beta, etc, so it isn't a good way :/ Yes it is
Angius
Angius20h ago
Ah, so it's not about this specific package, but rather any package
moi15moi
moi15moiOP20h ago
Exactly, it was only a example
Angius
Angius20h ago
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 easy
Unknown User
Unknown User20h ago
Message Not Public
Sign In & Join Server To View
Angius
Angius20h ago
Yeah, just saw it in the docs
Unknown User
Unknown User19h ago
Message Not Public
Sign In & Join Server To View
Angius
Angius19h ago
Would even work for calendar versions and anything else. The way nuget determines prerelease is that dash anyway
Unknown User
Unknown User19h ago
Message Not Public
Sign In & Join Server To View
Angius
Angius19h ago
So even if it was 2023.5 then 2023.5-ungabunga would be the prerelease
Unknown User
Unknown User19h ago
Message Not Public
Sign In & Join Server To View
moi15moi
moi15moiOP19h ago
Thanks 🙂 !close
Accord
Accord19h ago
Closed!
Want results from more Discord servers?
Add your server