-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
make-release-build
executable file
·51 lines (41 loc) · 1 KB
/
make-release-build
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
#!/bin/bash
# bash is required because we need bash's printf to guarantee a cross-platform
# timestamp format.
set -e
set -x
if [ -z $ANDROID_HOME ]; then
if [ -e ~/.android/bashrc ]; then
. ~/.android/bashrc
else
echo "ANDROID_HOME must be set!"
exit
fi
fi
# standardize timezone to reduce build differences
export TZ=UTC
git reset --hard
git clean -fdx
./setup-ant
ant release-all
jarname=panic-$(git describe)
rm -f ${jarname}*.asc
# standardize timestamps in ZIP headers
if which strip-nondeterminism > /dev/null; then
for f in ${jarname}*.jar; do
strip-nondeterminism -t jar -T $(git log -n1 --format=format:%at) $f
done
fi
for f in ${jarname}*.jar; do
sha256sum $f
done
if which gpg > /dev/null; then
if [ -z "`gpg --list-secret-keys`" ]; then
echo "No GPG secret keys found, not signing APK"
else
for f in ${jarname}*.*; do
gpg --armor --detach-sign $f
done
fi
else
echo "gpg not found, not signing APK"
fi