1414 # First job: Wait for PyPI to have the package
1515 wait-for-pypi :
1616 runs-on : ubuntu-latest
17+ # Add a timeout to this specific job
18+ timeout-minutes : 25
1719 outputs :
1820 version : ${{ steps.get-version.outputs.version }}
1921 sha256 : ${{ steps.get-sha.outputs.sha256 }}
2325 run : |
2426 if [ "${{ github.event_name }}" == "release" ]; then
2527 VERSION="${{ github.event.release.tag_name }}"
28+ # Remove 'v' prefix if it exists
2629 VERSION="${VERSION#v}"
2730 else
2831 VERSION="${{ github.event.inputs.version }}"
@@ -34,10 +37,11 @@ jobs:
3437 id : wait-pypi
3538 run : |
3639 VERSION="${{ steps.get-version.outputs.version }}"
37- MAX_ATTEMPTS=20
40+ # Increased attempts and sleep time for a total wait of up to 20 minutes
41+ MAX_ATTEMPTS=40
3842 SLEEP_TIME=30
3943
40- echo "Checking for omnipkg version $VERSION on PyPI..."
44+ echo "Checking for omnipkg version $VERSION on PyPI (will try for up to 20 minutes) ..."
4145
4246 for i in $(seq 1 $MAX_ATTEMPTS); do
4347 echo "Attempt $i/$MAX_ATTEMPTS..."
@@ -49,18 +53,20 @@ jobs:
4953 if [ "$HTTP_CODE" = "200" ]; then
5054 echo "✓ Package version found on PyPI API!"
5155
52- # Also verify the tar.gz file is downloadable
56+ # Also verify the tar.gz file is downloadable from the CDN
5357 DOWNLOAD_URL="https://files.pythonhosted.org/packages/source/o/omnipkg/omnipkg-$VERSION.tar.gz"
5458 DOWNLOAD_CODE=$(curl -s -o /dev/null -w "%{http_code}" -I "$DOWNLOAD_URL")
5559
5660 if [ "$DOWNLOAD_CODE" = "200" ] || [ "$DOWNLOAD_CODE" = "302" ]; then
57- echo "✓ Package file is downloadable!"
61+ echo "✓ Package file is downloadable! Proceeding."
62+ # Give it a few extra seconds just in case
63+ sleep 5
5864 break
5965 else
60- echo "⚠ Package found in API but file not yet available (HTTP $DOWNLOAD_CODE)"
66+ echo "⚠ Package found in API but file not yet available on CDN (HTTP $DOWNLOAD_CODE)"
6167 fi
6268 else
63- echo "Package not yet available (HTTP $HTTP_CODE)"
69+ echo "Package not yet available on API (HTTP $HTTP_CODE)"
6470 fi
6571
6672 if [ $i -eq $MAX_ATTEMPTS ]; then
6975 exit 1
7076 fi
7177
72- echo "Waiting ${SLEEP_TIME}s..."
78+ echo "Waiting ${SLEEP_TIME}s before next attempt ..."
7379 sleep $SLEEP_TIME
7480 done
7581
@@ -79,32 +85,22 @@ jobs:
7985 VERSION="${{ steps.get-version.outputs.version }}"
8086
8187 echo "Downloading package from PyPI..."
82- # Try the files.pythonhosted.org URL first (CDN)
8388 if ! curl -L -f -o "omnipkg-$VERSION.tar.gz" \
8489 "https://files.pythonhosted.org/packages/source/o/omnipkg/omnipkg-$VERSION.tar.gz"; then
85- # Fallback to pypi.org URL
86- echo "CDN failed, trying pypi.org..."
90+ echo "CDN failed, trying pypi.org fallback..."
8791 curl -L -f -o "omnipkg-$VERSION.tar.gz" \
8892 "https://pypi.org/packages/source/o/omnipkg/omnipkg-$VERSION.tar.gz"
8993 fi
9094
91- # Verify file size
9295 FILE_SIZE=$(wc -c < "omnipkg-$VERSION.tar.gz")
9396 echo "File size: $FILE_SIZE bytes"
94-
9597 if [ "$FILE_SIZE" -lt 10000 ]; then
96- echo "Error: File too small ($FILE_SIZE bytes)"
98+ echo "Error: Downloaded file is too small ($FILE_SIZE bytes), which is suspicious. "
9799 exit 1
98100 fi
99101
100102 echo "Calculating SHA256..."
101- if command -v sha256sum &> /dev/null; then
102- SHA256=$(sha256sum "omnipkg-$VERSION.tar.gz" | cut -d' ' -f1)
103- elif command -v shasum &> /dev/null; then
104- SHA256=$(shasum -a 256 "omnipkg-$VERSION.tar.gz" | cut -d' ' -f1)
105- else
106- SHA256=$(python3 -c "import hashlib; print(hashlib.sha256(open('omnipkg-$VERSION.tar.gz', 'rb').read()).hexdigest())")
107- fi
103+ SHA256=$(sha256sum "omnipkg-$VERSION.tar.gz" | cut -d' ' -f1)
108104
109105 echo "sha256=$SHA256" >> $GITHUB_OUTPUT
110106 echo "SHA256: $SHA256"
@@ -113,8 +109,11 @@ jobs:
113109 update-feedstock :
114110 needs : wait-for-pypi
115111 runs-on : ubuntu-latest
112+ # Add a timeout to this specific job
113+ timeout-minutes : 20
116114 if : github.event_name == 'release'
117115 steps :
116+ # ... (steps for this job remain the same) ...
118117 - name : Checkout your feedstock fork
119118 uses : actions/checkout@v4
120119 with :
@@ -135,11 +134,9 @@ jobs:
135134
136135 echo "Updating recipe/meta.yaml to version $VERSION with SHA256: $SHA256"
137136
138- # Update version and sha256 in meta.yaml
139137 sed -i "s/{% set version = \".*\" %}/{% set version = \"$VERSION\" %}/" recipe/meta.yaml
140138 sed -i "s/sha256: .*/sha256: $SHA256/" recipe/meta.yaml
141139
142- # Show the changes
143140 echo "=== Updated meta.yaml (first 30 lines) ==="
144141 head -30 recipe/meta.yaml
145142
@@ -178,16 +175,20 @@ jobs:
178175 base : main
179176 push-to-fork : 1minds3t/omnipkg-feedstock
180177
178+
181179 # Third job: Build conda packages for your own channel
182180 build-and-upload :
183181 needs : wait-for-pypi
184182 runs-on : ${{ matrix.os }}
183+ # Add a timeout to this job, which applies to each matrix instance
184+ timeout-minutes : 45
185185 strategy :
186186 matrix :
187187 os : [ubuntu-latest, windows-latest, macos-latest]
188188 python-version : ['3.10', '3.11', '3.12']
189189
190190 steps :
191+ # ... (steps for this job remain the same) ...
191192 - name : Checkout code
192193 uses : actions/checkout@v4
193194
@@ -212,7 +213,6 @@ jobs:
212213
213214 echo "Using version $VERSION with SHA256: $SHA256"
214215
215- # Update the version and sha256 in meta.yaml (cross-platform sed)
216216 if [[ "$RUNNER_OS" == "macOS" ]]; then
217217 sed -i '' "s/{% set version = \".*\" %}/{% set version = \"$VERSION\" %}/" omnipkg/conda-recipe/meta.yaml
218218 sed -i '' "s/sha256: .*/sha256: $SHA256/" omnipkg/conda-recipe/meta.yaml
0 commit comments