-
-
Notifications
You must be signed in to change notification settings - Fork 611
/
build_and_upload.sh
30 lines (22 loc) · 992 Bytes
/
build_and_upload.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
#!/bin/bash
echo "Build and upload Conda binaries"
# ANACONDA_TOKEN should be provided
# How to generate ANACONDA_TOKEN: https://docs.anaconda.com/anaconda-cloud/user-guide/tasks/work-with-accounts#creating-access-tokens
# https://conda.io/docs/user-guide/tasks/build-packages/install-conda-build.html
if [ -z $ANACONDA_TOKEN ]; then
echo "Can not find ANACONDA_TOKEN env variable"
echo "Please, export ANACONDA_TOKEN=<username> before calling this script"
exit 1
fi
if [ -z $UPLOAD_USER ]; then
echo "Can not find UPLOAD_USER env variable"
echo "Please, export UPLOAD_USER=<username> before calling this script"
exit 1
fi
set -xeu
conda install -y conda-build conda-verify anaconda-client
conda config --set anaconda_upload no
conda build --no-test --output-folder conda_build conda.recipe -c pytorch
# Upload to Anaconda
conda config --set anaconda_upload yes
ls conda_build/*/*.tar.bz2 | xargs -I {} anaconda -v -t $ANACONDA_TOKEN upload -u $UPLOAD_USER {}