Closed rtyley closed 5 months ago
Thanks! I can confirm that the badges on this sample project now show the correct release version:
https://index.scala-lang.org/rtyley/sample-project-using-gha-scala-library-release-workflow/badges
...even though there are 'higher' number preview releases:
I just noticed that the versions shown in the Scaladex badges for
content-api-firehose-client
don't match - one is showing the stable release number (1.0.12
👍), and the other is showing a pre-release (less good):The 'Latest version' badge is showing a good version:![image](https://github.com/scalacenter/scaladex/assets/52038/e02c58d9-b340-4860-82cf-6ed69b9f4841)
1.0.12
The 'JVM badge':![image](https://github.com/scalacenter/scaladex/assets/52038/4a4a1617-308e-486e-ab08-8ee363c11a3e)
1.0.13-PREVIEW.rt-dbremove-travis-file.2024-01-10T1738.6e259255
The JVM badge shows a latest-by-scala-version summary I introduced with https://github.com/scalacenter/scaladex/pull/660, but it looks like I missed out logic which is present in the other badge - preferring to show releases, and only showing pre-releases if they are the only available version!
This PR fixes the behaviour on the latest-by-scala-version badge to match the behaviour of the other badge - it does this with a new
PreferReleases
ordering forSemanticVersion
s. I did have a look to see if I could refactor the logic used by the first badge to also make use of this ordering, but it would have required a bigger refactoring:https://github.com/scalacenter/scaladex/blob/9c07f4f13e1053d8f4f3179d6f338f566be8bf22/modules/server/src/main/scala/scaladex/server/route/Badges.scala#L159-L162