@@ -14,24 +14,20 @@ if [[ -z ${CONDA_DEFAULT_ENV} ]]; then
1414fi
1515
1616# meant for a TravisCI deploy environment but easily tricked into running locally
17+ # by setting these
1718if [[ " $TRAVIS " != " true" || -z " $TRAVIS_BRANCH " || -z " ${PACKAGE_NAME} " ]]; then
1819 echo " conda_upload.sh is meant to run on TravisCI"
1920 exit -2
2021fi
2122
22- # set the parent of conda-bld, the else isn't needed for TravisCI but
23- # simplifies local testing
24- if [ $USER = " travis" ]; then
25- bld_prefix=" /home/travis/miniconda" # from the .travis.yml
26- else
27- bld_prefix=${CONDA_PREFIX}
28- fi
23+ # as in .travis.yml or use bld_prefix=${CONDA_PREFIX} for local testing
24+ bld_prefix=" /home/travis/miniconda"
2925
3026# on TravisCI there should be a single linux-64 package tarball. insist
3127tarball=` /bin/ls -1 ${bld_prefix} /conda-bld/linux-64/${PACKAGE_NAME} -* -* .tar.bz2`
3228n_tarballs=` echo " ${tarball} " | wc -w`
3329if (( $n_tarballs != 1 )) ; then
34- echo " found $n_tarballs package tarballs there must be exactly 1"
30+ echo " found $n_tarballs $PACKAGE_NAME tarballs there must be exactly 1"
3531 echo " $tarball "
3632 exit -3
3733fi
@@ -52,33 +48,38 @@ mmp=`echo $version | sed -n "s/\(\([0-9]\+\.\)\{1,2\}[0-9]\+\).*/\1/p"`
5248# * is the tag vMajor.Minor.Patch (TravisCI treats tagged commits as a branch)?
5349if [[ " ${version} " = " $mmp " && $TRAVIS_BRANCH = v$mmp ]]; then
5450 is_release=" true"
55- conda install anaconda-client
51+ label_param= " --label main "
5652else
5753 is_release=" false"
54+ label_param=" --label pre_release"
5855fi
5956
6057# POSIX trick sets $ANACONDA_TOKEN if unset or empty string
6158ANACONDA_TOKEN=${ANACONDA_TOKEN:- [not_set]}
62- conda_cmd=" anaconda --token $ANACONDA_TOKEN upload ${tarball} "
59+ conda_cmd=" anaconda --token $ANACONDA_TOKEN upload ${tarball} ${label_param} "
6360
6461# thus far ...
6562echo " conda meta.yaml version: $version "
6663echo " package name: $PACKAGE_NAME "
6764echo " conda-bld: ${bld_prefix} /conda-bld/linux-64"
6865echo " tarball: $tarball "
66+ echo " travis tag: $TRAVIS_TAG "
6967echo " travis branch: $TRAVIS_BRANCH "
7068echo " is_release: $is_release "
69+ echo " conda_label: ${label_param} "
7170echo " conda upload command: ${conda_cmd} "
7271
73- # if the token is in the ENV and this is a vN.N.N tagged commit
72+ # if the token is in the ENV
7473# attempt the upload
7574# else
7675# skip the upload and exit happy
7776#
7877# conda upload knows the destination from the token
79- if [[ $ANACONDA_TOKEN != " [not_set]" && $is_release = " true" ]]; then
8078
81- echo " uploading to Anconda Cloud: $PACKAGE_NAME $ $version ..."
79+ if [[ $ANACONDA_TOKEN != " [not_set]" ]]; then
80+
81+ echo " uploading to Anconda Cloud: $PACKAGE_NAME $ $version $TRAVIS_BRANCH $label_param ..."
82+ conda install anaconda-client
8283 if ${conda_cmd} ; then
8384 echo " OK"
8485 else
0 commit comments