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