Skip to content

Commit 050e75b

Browse files
authored
Update conda_build.yml
1 parent 4d8cd57 commit 050e75b

1 file changed

Lines changed: 26 additions & 9 deletions

File tree

.github/workflows/conda_build.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,40 @@ jobs:
3131
channel-priority: strict
3232

3333
- name: Install conda-build and anaconda-client
34-
shell: bash -l {0}
35-
run: |
36-
conda install conda-build anaconda-client -y
37-
38-
- name: Update meta.yaml version and hash
3934
shell: bash -l {0}
4035
run: |
4136
if [ "${{ github.event_name }}" == "release" ]; then
4237
VERSION="${{ github.event.release.tag_name }}"
43-
VERSION="${VERSION#v}" # Remove 'v' prefix if present
38+
VERSION="${VERSION#v}"
4439
else
4540
VERSION="${{ github.event.inputs.version }}"
4641
fi
4742
48-
# CORRECTED: Use curl for all platforms for consistency.
49-
echo "Downloading omnipkg version $VERSION..."
50-
curl -L -o "omnipkg-$VERSION.tar.gz" "https://pypi.org/packages/source/o/omnipkg/omnipkg-$VERSION.tar.gz"
43+
# --- START THE FIX: THE RESILIENT RETRY LOOP ---
44+
max_attempts=10
45+
attempt=1
46+
url="https://pypi.org/packages/source/o/omnipkg/omnipkg-$VERSION.tar.gz"
47+
48+
echo "Attempting to download source from $url..."
49+
50+
while [ $attempt -le $max_attempts ]; do
51+
# Use --fail to make curl return a non-zero exit code on 404
52+
curl -L --fail -o "omnipkg-$VERSION.tar.gz" "$url"
53+
54+
if [ $? -eq 0 ]; then
55+
echo "✅ Download successful on attempt $attempt."
56+
break
57+
else
58+
echo "⚠️ Attempt $attempt failed. PyPI might not be ready yet. Retrying in 15 seconds..."
59+
sleep 15
60+
attempt=$((attempt + 1))
61+
fi
62+
done
63+
64+
if [ $attempt -gt $max_attempts ]; then
65+
echo "❌ Failed to download source after $max_attempts attempts. Aborting."
66+
exit 1
67+
fi
5168
5269
# CORRECTED: Use Python for a truly cross-platform SHA256 calculation.
5370
echo "Calculating SHA256 hash..."

0 commit comments

Comments
 (0)