diff --git a/.github/workflows/push_pypi.yml b/.github/workflows/push_pypi.yml index f1a8a166a..684024941 100644 --- a/.github/workflows/push_pypi.yml +++ b/.github/workflows/push_pypi.yml @@ -34,10 +34,10 @@ jobs: run: | for pkg in core client; do localVer=$(awk -F' *= *' '/version/{gsub(/"/,"",$2);print $2}' "${pkg}/pyproject.toml") - curl -s "https://pypi.org/pypi/lomas-core/${localVer}/json" | jq -e -r '.last_serial' - if [ $? -eq 0 ]; then - echo "lomas-${pkg} v${localVer} already published" + res=$(curl -s "https://pypi.org/pypi/lomas-${pkg}/${localVer}/json" | jq -r '.last_serial') + if [ "$res" = "null" ]; then + uv publish --check-url https://pypi.org/simple --token ${{ secrets.PYPI_TOKEN }} dist/lomas_${pkg}-${localVer}-* else - uv publish --check-url https://pypi.org/simple --token ${{ secrets.PYPI_TOKEN }} "dist/lomas_${pkg}-${localVer}-*" + echo "lomas-${pkg} v${localVer} already published" fi done