forked from iamsaswata/imdlib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy_conda.sh
105 lines (90 loc) · 2.58 KB
/
deploy_conda.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
echo "========================"
echo "========================"
echo "Showing home directory"
echo $HOME
ls
echo "========================"
echo "========================"
echo "Downaloading miniconda"
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
ls
echo "========================"
echo "========================"
echo "========================"
echo "Setting up miniconda"
chmod +x miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
echo "========================"
echo "========================"
echo "========================"
echo "Update miniconda"
conda install -y -c conda-forge python=3.10
conda config --set always_yes true --set changeps1 no
# conda update -q conda
conda install -y conda-build
conda install -y anaconda-client
echo "========================"
echo "========================"
echo "========================"
echo "install requirements.tt"
pip install -r requirements.txt
echo "========================"
echo "========================"
echo "======================"
# change the package name to the existing PyPi package you would like to build
pkg='imdlib'
echo $PWD
array=( 3.10 )
echo "Building conda package ..."
cd ~
echo $PWD
# conda skeleton pypi $pkg
# KeyError: 'extras_require'
# https://github.com/conda/conda-build/issues/4354
conda skeleton pypi $pkg --python-version 3.6
cd $pkg
echo $PWD
cd ~
echo "======================"
echo "========================"
echo "======================"
echo "Building conda packages"
echo $PWD
for i in "${array[@]}"
do
conda-build --python $i $pkg
done
echo "========================"
# convert package to other platforms
echo "========================="
echo "Converting conda packages"
echo "========================="
cd ~
echo $PWD
platforms=( linux-64 win-64 )
find $HOME/miniconda/conda-bld/linux-64/ -name *.tar.bz2 | while read file
do
echo $file
#conda convert --platform all $file -o $HOME/conda-bld/
for platform in "${platforms[@]}"
do
conda convert --platform $platform $file -o $HOME/miniconda/conda-bld/
done
done
echo "========================="
echo "Converting finished"
echo "========================="
echo "========================="
echo "Uploading conda packages"
echo "========================="
find $HOME/miniconda/conda-bld/ -name *.tar.bz2 | while read file
do
echo $file
anaconda -t $ANACONDA_TOKEN upload $file
done
echo "Building conda package done!"
echo "==================================="
echo "Succeessful submission to anaconda"
echo "==================================="