Skip to content

Commit

Permalink
FIX: del list, docker handle only str/bool/number
Browse files Browse the repository at this point in the history
- parse string in case of multiple labels
  • Loading branch information
skoudoro committed Dec 8, 2023
1 parent 9740248 commit d6241ac
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ inputs:
anaconda_nightly_upload_labels:
description: 'Labels assigned to the uploaded artifacts'
required: false
default: [main]
default: main

runs:
using: 'docker'
Expand Down
19 changes: 18 additions & 1 deletion cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@ if [ -z "${ANACONDA_TOKEN}" ]; then
exit -1
fi

if [ -z ${ANACONDA_LABELS} ]; then
echo "ANACONDA_LABELS is empty , using default label (main)..."
ANACONDA_LABELS="--label main"
else
# Count the number of words in the string
label_count=$(echo "$ANACONDA_LABELS" | wc -w)
if [ "$label_count" -gt 1 ]; then
formatted_labels=""
for label in ${ANACONDA_LABELS}; do
formatted_labels+="--label ${label} "
done
ANACONDA_LABELS="${formatted_labels}"
else
ANACONDA_LABELS="--label ${ANACONDA_LABELS}"
fi
fi

# Install anaconda-client from lock file
echo "Installing anaconda-client from upload-nightly-action conda-lock lock file..."
micromamba create \
Expand All @@ -57,6 +74,6 @@ echo "Uploading wheels to anaconda.org..."
anaconda --token "${ANACONDA_TOKEN}" upload \
--force \
--user "${ANACONDA_ORG}" \
--label "${ANACONDA_LABELS}" \
"${ANACONDA_LABELS}" \
"${INPUT_ARTIFACTS_PATH}"/*.whl
echo "Index: https://pypi.anaconda.org/${ANACONDA_ORG}/simple"

0 comments on commit d6241ac

Please sign in to comment.