From 87cd76435dc8d0e5a03fa46d46ee595001bbd02c Mon Sep 17 00:00:00 2001 From: Omar-V2 Date: Tue, 18 Aug 2026 19:14:09 +0100 Subject: [PATCH] Fetch the correct version from PyPI in the release workflow --- .github/workflows/release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e870cfe..824a30c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -115,9 +115,9 @@ jobs: - name: Get latest version published on PyPI id: get_pypi_version run: | - response=$(curl -s ${{ env.PYPI_URL }}/${{ env.PACKAGE_NAME }}/json || echo "{}") - pypi_version=$(echo $response | jq --raw-output "select(.releases != null) | .releases | keys_unsorted | last") - if [ -z "$pypi_version" ]; then + # info.version is the current release; .releases keys are lexicographic, not semver + pypi_version=$(curl -s ${{ env.PYPI_URL }}/${{ env.PACKAGE_NAME }}/json | jq --raw-output ".info.version // empty") + if [ -z "$pypi_version" ] || [ "$pypi_version" = "null" ]; then echo "Package not found on PyPI." pypi_version="0.0.0" fi