Skip to content

Commit

Permalink
Merge pull request #11683 from rouault/ci_conda_upload_harden
Browse files Browse the repository at this point in the history
CI: gdal-master conda upload: harden script to detect errors
  • Loading branch information
rouault authored Jan 17, 2025
2 parents 3da6544 + f514b5c commit b0c93fe
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 b0c93fe

Please sign in to comment.