-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto-build-from-push.sh
44 lines (40 loc) · 1.02 KB
/
auto-build-from-push.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
#!/usr/bin/env bash
if [ -z $OLD_REF ]; then
echo "Define OLD_REF envvar"
exit 1
fi
if [ -z $GITHUB_REF ]; then
echo "Define GITHUB_REF envvar"
exit 1
fi
echo "OSTYPE: $OSTYPE"
case "$OSTYPE" in
darwin*) arch=macos;;
linux*) arch=linux;;
msys*) arch=win64;;
*) echo "unknown: $OSTYPE"; exit 1;;
esac
to_build() {
if [[ "${arch}" == "linux" ]]; then
[ ! -f "$1/skip-linux" ]
else
[ -f "$1/build-${arch}" ]
fi
}
set -ex
mod=$(git diff $OLD_REF..$GITHUB_REF --name-only|cut -d/ -f1|uniq)
mod=$(for e in $mod; do if [ -f $e/meta.yaml ] && to_build $e; then echo $e; fi; done)
echo $mod
if [ -z "${mod}" ]; then
exit 0
fi
conda install -y conda-libmamba-solver
conda config --set solver libmamba
conda install -y anaconda-client conda-build conda-verify
conda config --set anaconda_upload yes
for e in ${mod}; do
cd ${e}
conda build --user colomoto --token $ANACONDA_TOKEN --no-force-upload\
-c defaults -c potassco -c conda-forge -c colomoto .
cd ..
done