File tree Expand file tree Collapse file tree 2 files changed +2
-9
lines changed
Expand file tree Collapse file tree 2 files changed +2
-9
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 @@ -261,13 +261,9 @@ jobs:
261261 . venv/bin/activate
262262 PACKAGE_VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
263263 PACKAGE_NAME=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['name'])")
264-
265- # Use jq to check for the version in the releases object
266- EXISTING_VERSIONS=$(curl -s "https://test.pypi.org/pypi/$PACKAGE_NAME/json" | jq '.releases | keys[]')
267-
268264 echo "Checking for package: $PACKAGE_NAME==$PACKAGE_VERSION"
269265
270- if [[ "$EXISTING_VERSIONS" =~ " $PACKAGE_VERSION" ]] ; then
266+ if curl -s "https://test.pypi.org/pypi/$PACKAGE_NAME/json" | jq -r '.releases | keys[]' | grep -q "^ $PACKAGE_VERSION$" ; then
271267 echo "Package version already exists. Skipping upload."
272268 echo "should_publish=false" >> $GITHUB_OUTPUT
273269 else
You can’t perform that action at this time.
0 commit comments