forked from moble/scri
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.conda_deploy.sh
42 lines (26 loc) · 1.3 KB
/
.conda_deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# this script uses the ANACONDA_TOKEN env var.
# to create a token:
# >>> anaconda login
# >>> anaconda auth -c -n travis --max-age 307584000 --url https://anaconda.org/moble/quaternion --scopes "api:write api:read"
# then go to the Travis-CI settings page for this package, and create an environment variable with that token.
# I stole these ideas from Yoav Ram <https://gist.github.com/yoavram/05a3c04ddcf317a517d5>
echo "Trying to run deploy script"
set -e
PACKAGENAME="scri"
if [[ "${CONDA}" == "true" ]]; then
conda config --set anaconda_upload no;
conda install -n root conda-build anaconda-client
echo "Building package"
conda build .
echo "Converting conda package..."
conda convert -f --platform osx-64 $HOME/miniconda/conda-bld/linux-64/${PACKAGENAME}-*.tar.bz2 --output-dir conda-bld/
conda convert -f --platform linux-32 $HOME/miniconda/conda-bld/linux-64/${PACKAGENAME}-*.tar.bz2 --output-dir conda-bld/
conda convert -f --platform linux-64 $HOME/miniconda/conda-bld/linux-64/${PACKAGENAME}-*.tar.bz2 --output-dir conda-bld/
echo "Deploying to Anaconda.org..."
anaconda -t $ANACONDA_TOKEN upload --force --no-progress conda-bld/**/${PACKAGENAME}-*.tar.bz2
echo "Successfully deployed to Anaconda.org."
else
echo "Skipping deployment"
fi
exit 0