Skip to content

Commit 7291b0e

Browse files
committed
Small rearrangements to version_check script
1 parent b3c033b commit 7291b0e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

.github/scripts/version_check.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ if [ -z "$VERSION" ]; then
1717
fi
1818
echo "Version is $VERSION"
1919

20-
INDEX="${PYPI_INDEX:-pypi.org}"
21-
2220
# Step 2: Get package name from pyproject.toml
2321
PACKAGE_NAME=$(awk -F'=' '/^name/ {gsub(/[" ]/, "", $2); print $2}' "$PYPROJECT_FILE")
2422
if [ -z "$PACKAGE_NAME" ]; then
@@ -27,12 +25,13 @@ fi
2725
echo "PACKAGE_NAME is $PACKAGE_NAME"
2826

2927
# Step 3: Get latest release version from PyPI
28+
INDEX="${PYPI_INDEX:-pypi.org}"
3029
PUBLISHED_VERSIONS=$(curl -s "https://$INDEX/pypi/$PACKAGE_NAME/json" | jq -r '.releases | keys | .[]')
3130

3231
if [ -z "$PUBLISHED_VERSIONS" ]; then
33-
error_exit "Unable to retrieve published version from PyPI for $PACKAGE_NAME"
32+
error_exit "Unable to retrieve published version from $INDEX for $PACKAGE_NAME"
3433
fi
35-
echo "Published PyPI versions are $PUBLISHED_VERSIONS"
34+
echo "Published PyPI versions on $INDEX are $PUBLISHED_VERSIONS"
3635

3736
# Step 4: Check if current version is in the list of published versions
3837
PUBLISHING="true"

0 commit comments

Comments
 (0)