Skip to content

Commit

Permalink
BUG: Fix binary comparison in upload_wheels.sh
Browse files Browse the repository at this point in the history
Also quote all variables
  • Loading branch information
stefanv committed Nov 29, 2022
1 parent fe31f6b commit bfcc9dc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tools/wheels/upload_wheels.sh
@@ -1,3 +1,5 @@
#!/bin/bash

set_travis_vars() {
# Set env vars
echo "TRAVIS_EVENT_TYPE is $TRAVIS_EVENT_TYPE"
Expand All @@ -13,7 +15,7 @@ set_travis_vars() {
else
IS_PUSH="false"
fi
if [[ "$TRAVIS_EVENT_TYPE" == "cron" || -v CIRRUS_CRON ]]; then
if [[ "$TRAVIS_EVENT_TYPE" == "cron" || -v "$CIRRUS_CRON" ]]; then
IS_SCHEDULE_DISPATCH="true"
elif [[ "$TRAVIS_EVENT_TYPE" == "api" || "$CIRRUS_API_CREATED" == "true" ]]; then
# Manual CI run, so upload
Expand Down Expand Up @@ -41,20 +43,20 @@ set_upload_vars() {
fi
}
upload_wheels() {
echo ${PWD}
echo "${PWD}"
if [[ ${ANACONDA_UPLOAD} == true ]]; then
if [ -z ${TOKEN} ]; then
if [ -z "${TOKEN}" ]; then
echo no token set, not uploading
else
python -m pip install \
git+https://github.com/Anaconda-Platform/anaconda-client.git@be1e14936a8e947da94d026c990715f0596d7043
# sdists are located under dist folder when built through setup.py
if compgen -G "./dist/*.gz"; then
echo "Found sdist"
anaconda -q -t ${TOKEN} upload --skip -u ${ANACONDA_ORG} ./dist/*.gz
anaconda -q -t "${TOKEN}" upload --skip -u "${ANACONDA_ORG}" ./dist/*.gz
elif compgen -G "./wheelhouse/*.whl"; then
echo "Found wheel"
anaconda -q -t ${TOKEN} upload --skip -u ${ANACONDA_ORG} ./wheelhouse/*.whl
anaconda -q -t "${TOKEN}" upload --skip -u "${ANACONDA_ORG}" ./wheelhouse/*.whl
else
echo "Files do not exist"
return 1
Expand Down

0 comments on commit bfcc9dc

Please sign in to comment.