File tree Expand file tree Collapse file tree 2 files changed +2
-8
lines changed
Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change 4040 PACKAGE_VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
4141 PACKAGE_NAME=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['name'])")
4242
43- # Use jq to check for the version in the releases object
44- EXISTING_VERSIONS=$(curl -s "https://pypi.org/pypi/$PACKAGE_NAME/json" | jq '.releases | keys[]')
45-
4643 echo "Checking for package: $PACKAGE_NAME==$PACKAGE_VERSION"
4744
48- if [[ "$EXISTING_VERSIONS" =~ " $PACKAGE_VERSION" ]] ; then
45+ if curl -s "https://pypi.org/pypi/$PACKAGE_NAME/json" | jq -r '.releases | keys[]' | grep -q "^ $PACKAGE_VERSION$" ; then
4946 echo "Package version already exists. Skipping upload."
5047 echo "should_publish=false" >> $GITHUB_OUTPUT
5148 else
Original file line number Diff line number Diff line change @@ -298,12 +298,9 @@ jobs:
298298 PACKAGE_VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
299299 PACKAGE_NAME=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['name'])")
300300
301- # Use jq to check for the version in the releases object
302- EXISTING_VERSIONS=$(curl -s "https://test.pypi.org/pypi/$PACKAGE_NAME/json" | jq '.releases | keys[]')
303-
304301 echo "Checking for package: $PACKAGE_NAME==$PACKAGE_VERSION"
305302
306- if [[ "$EXISTING_VERSIONS" =~ " $PACKAGE_VERSION" ]] ; then
303+ if curl -s "https://test.pypi.org/pypi/$PACKAGE_NAME/json" | jq -r '.releases | keys[]' | grep -q "^ $PACKAGE_VERSION$" ; then
307304 echo "Package version already exists. Skipping upload."
308305 echo "should_publish=false" >> $GITHUB_OUTPUT
309306 else
You can’t perform that action at this time.
0 commit comments