farridav / django-jazzmin

Jazzy theme for Django
https://django-jazzmin.readthedocs.io
MIT License
1.54k stars 272 forks source link

Fix the sorting of `LATEST_RELEASE` to get the top result #566

Closed PacificGilly closed 2 months ago

PacificGilly commented 2 months ago

A silly mistake where I sorted the list of the versions, but never extracted the top results!

>>> LATEST_RELEASE_TEST_PYPI=$(curl -s https://test.pypi.org/rss/project/django-jazzmin/releases.xml | sed -n 's/\s*<title>\([{a,b}0-9.]*\).*/\1/p' | head -n 2 | xargs)
>>> LATEST_RELEASE_GITHUB=$(curl -s "https://api.github.com/repos/farridav/django-jazzmin/tags" | jq -r '.[0].name[1:]')
>>> LATEST_RELEASE=$(printf "${LATEST_RELEASE_GITHUB}\n${LATEST_RELEASE_TEST_PYPI}" | sort -V -r | head -n 1)
>>> poetry version $LATEST_RELEASE
... Bumping version from 3.0.1a0 to 3.0.0
>>> poetry version prerelease
... Bumping version from 3.0.0 to 3.0.1a0