/
checkbuild.sh
executable file
·68 lines (49 loc) · 1.04 KB
/
checkbuild.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
#!/bin/bash
set -e
FORCE=0
if [ ! -d "corbenik" ]; then
git clone --recursive https://github.com/chaoskagami/corbenik corbenik
FORCE=1
fi
cd corbenik
# ==============================================
git remote update
git fetch
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse @{u})
BASE=$(git merge-base @ @{u})
if [ $LOCAL = $REMOTE ]; then
echo "Up-to-date"
if [ $FORCE = 0 ]; then
exit 0
fi
elif [ $LOCAL = $BASE ]; then
echo "Need to pull"
git pull
git submodule update --init --recursive
else
echo "Diverged"
exit 1
fi
unset CC
unset CXX
unset LD
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
export PATH=$PATH:$DEVKITARM/bin
git clean -fxd
git submodule foreach git clean -fxd
./autogen.sh
./configure --host=arm-none-eabi --prefix=/skeith
make
cd out
zip -r9 ../../rel/release.zip *
sha512sum ../../rel/release.zip | sed 's|../../rel/||g' > ../../rel/release.zip.sha512
cd ..
REV=$(git rev-parse HEAD)
cd ..
git add rel
git commit -m "Automated - build succeeded: $REV"
git push origin master
exit 0