Skip to content

Commit

Permalink
CI: gdal-master conda upload: harden script to detect errors
Browse files Browse the repository at this point in the history
As shown in #11676 our current
strategy is to always consider the upload stage to have succeeded.
Change that to fail on errors, or lack of packages to upload.
  • Loading branch information
rouault committed Jan 17, 2025
1 parent 3da6544 commit 5f83f51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ jobs:
path: ./gdal-feedstock/packages/

- name: Deploy to gdal-master Conda channel
if: github.ref == 'refs/heads/master'
if: github.repository == 'OSGeo/GDAL' && github.ref == 'refs/heads/master'
shell: bash -l {0}
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
source ../ci/travis/conda/upload.sh || true
source ../ci/travis/conda/upload.sh
working-directory: ./gdal-feedstock
14 changes: 8 additions & 6 deletions ci/travis/conda/upload.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
#!/bin/bash

set -e

if [ -z "${ANACONDA_TOKEN+x}" ]
then
echo "Anaconda token is not set, not uploading"
exit 0;
echo "Anaconda token is not set!"
exit 1
fi

ls
pwd
find .

if [ -z "${ANACONDA_TOKEN}" ]
then
echo "Anaconda token is empty, not uploading"
exit 0;
if [[ -n `find . -name "*gdal*.conda"` ]]; then
echo "Found packages to upload"
else
echo "No packages matching *gdal*.conda to upload found"
exit 1
fi

echo "Anaconda token is available, attempting to upload"
Expand Down

0 comments on commit 5f83f51

Please sign in to comment.