Skip to content

Commit 91ef341

Browse files
committed
revert pipeline from using published action
1 parent 5d19e5c commit 91ef341

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/scripts/version_check.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
# This script is copied directly from https://github.com/MathieuMoalic/action-python-package-new-version/blob/main/entrypoint.sh
44
# This is just until there is extra functionality as part of that repo to allow specifying a different index.
55

6+
########## helper ##########
7+
error_exit() {
8+
echo "Error: $1" >&2
9+
exit 1
10+
}
11+
612
# Check if pyproject.toml exists
713
PYPROJECT_FILE=pyproject.toml
814

@@ -26,7 +32,10 @@ echo "PACKAGE_NAME is $PACKAGE_NAME"
2632

2733
# Step 3: Get latest release version from PyPI
2834
INDEX="${PYPI_INDEX:-pypi.org}"
29-
PUBLISHED_VERSIONS=$(curl -s "https://$INDEX/pypi/$PACKAGE_NAME/json" | jq -r '.releases | keys | .[]')
35+
echo "Index is $INDEX"
36+
echo "https://${INDEX}/pypi/${PACKAGE_NAME}/json"
37+
curl -s "https://${INDEX}/pypi/${PACKAGE_NAME}/json"
38+
PUBLISHED_VERSIONS=$(curl -s "https://${INDEX}/pypi/${PACKAGE_NAME}/json" | jq -r '.releases | keys | .[]')
3039

3140
if [ -z "$PUBLISHED_VERSIONS" ]; then
3241
error_exit "Unable to retrieve published version from $INDEX for $PACKAGE_NAME"

.github/workflows/pipeline.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,13 @@ jobs:
5757
- uses: actions/checkout@v4
5858
with:
5959
fetch-depth: 0
60-
- name: Check whether to release on indexes
61-
uses: MathieuMoalic/action-python-package-new-version@c4e361a9d28c1bcc19fe10bb4dcb751b625f031b
60+
- name: Check whether to release on pypi.org
61+
run: |
62+
./.github/scripts/version_check.sh
63+
- name: Check whether to release on test.pypi.org
64+
run: |
65+
export PYPI_INDEX=test.pypi.org
66+
./.github/scripts/version_check.sh
6267
- name: Globalise determined version
6368
id: set_version
6469
run: echo "package_version=${{ env.PACKAGE_VERSION }}" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)