1
1
# Anaconda Cloud package uploader.
2
2
#
3
- # * This assumes TravisCI ran conda build and the linux-64 package tar.bz
4
- # is in the default location /home/travis/miniconda3/conda-bld/linux-64
3
+ # * This assumes TravisCI ran conda build python=$PYV conda
4
+ # and the one linux-64 tarball is in the default location
5
+ # /home/travis/miniconda3/conda-bld/linux-64
5
6
#
6
7
# * The upload only fires if the package version from meta.yaml is
7
8
# (exactly) Major.Minor.Patch and $TRAVIS_BRANCH is master or
@@ -21,6 +22,9 @@ if [[ -z ${CONDA_DEFAULT_ENV} ]]; then
21
22
fi
22
23
23
24
# intended for TravisCI deploy but can be tricked into running locally
25
+ echo PACKAGE_NAME=$PACKAGE_NAME
26
+ echo TRAVIS=$TRAVIS
27
+ echo TRAVIS_BRANCH=$TRAVIS_BRANCH
24
28
if [[ " $TRAVIS " != " true" || -z " $TRAVIS_BRANCH " || -z " ${PACKAGE_NAME} " ]]; then
25
29
echo " conda_upload.sh is meant to run on TravisCI"
26
30
exit -2
30
34
# bld_prefix=${HOME}/miniconda3
31
35
bld_prefix=" /home/travis/miniconda" # from the .travis.yml
32
36
33
- # on travis there should be a single linux-64 package tarball. insist
34
- tarball=` /bin/ls -1 ${bld_prefix} /conda-bld/linux-64/${PACKAGE_NAME} -* -* .tar.bz2`
37
+ # for travis parallel jobs there should be 1 py3X linux-64 tarball, insist
38
+ tarball=` /bin/ls -1ta ${bld_prefix} /conda-bld/linux-64/${PACKAGE_NAME} -* -* .tar.bz2`
35
39
n_tarballs=` echo " ${tarball} " | wc -w`
36
40
if (( $n_tarballs != 1 )) ; then
37
41
echo " found $n_tarballs package tarballs there must be exactly 1"
@@ -55,7 +59,7 @@ mmp=$(echo $version | sed -n "s/\(\([0-9]\+\.\)\{1,2\}[0-9]\+\).*/\1/p")
55
59
# assume this is a dry run, unless version is M.N.P or M.N.P.devXXX and
56
60
# TRAVIS_BRANCH is master or a tagged vM.N.P release, in which case,
57
61
# set the destination label appropriately.
58
- label=" dry-run"
62
+ label=" dry-run"
59
63
if [[ " ${version} " =~ ^${mmp} (.dev[0-9]+){0,1}$ ]]; then
60
64
61
65
# commit to master uploads to pre-release
74
78
mkdir -p ${bld_prefix} /conda-convert/linux-64
75
79
cp ${tarball} ${bld_prefix} /conda-convert/linux-64
76
80
cd ${bld_prefix} /conda-convert
77
- conda convert -p linux-64 -p osx-64 -p win-64 linux-64/${PACKAGE_NAME} * tar.bz2
81
+ conda convert -p linux-64 -p osx-64 -p win-64 linux-64/${PACKAGE_NAME} - * - * . tar.bz2
78
82
79
83
# POSIX trick sets $ANACONDA_TOKEN if unset or empty string
80
84
ANACONDA_TOKEN=${ANACONDA_TOKEN:- [not_set]}
81
- conda_cmd=" anaconda --token $ANACONDA_TOKEN upload ./**/${PACKAGE_NAME} *.tar.bz2 --label ${label} --skip-existing"
85
+ conda_cmd=" anaconda --token $ANACONDA_TOKEN upload ./**/${PACKAGE_NAME} *-* .tar.bz2 --label ${label} --skip-existing"
82
86
83
87
# echo values to the TravisCI log for general info/debugging
84
88
echo " package name: $PACKAGE_NAME "
@@ -91,7 +95,7 @@ echo "tarball: $tarball"
91
95
echo " conda label: ${label} "
92
96
echo " conda upload command: ${conda_cmd} "
93
97
echo " platforms:"
94
- echo " $( ls ./** /${PACKAGE_NAME} * .tar.bz2) "
98
+ echo " $( ls ./** /${PACKAGE_NAME} - * - * .tar.bz2) "
95
99
96
100
# trigger the upload and destination or
97
101
if [[ $ANACONDA_TOKEN != " [not_set]" && ( $label = " main" || $label = " pre-release" ) ]]; then
0 commit comments