-
Notifications
You must be signed in to change notification settings - Fork 164
/
prepare_release.sh
executable file
·55 lines (45 loc) · 2.16 KB
/
prepare_release.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
#!/usr/bin/env bash
#
# Copyright © 2017 Viro Media. All rights reserved.
#
set -e
echo '========================================================================='
echo 'Cleaning local tarballs'
echo '========================================================================='
rm -rf ./*.tgz
echo '========================================================================='
echo 'Compiling TypeScript'
echo '========================================================================='
npm run build
echo '========================================================================='
echo 'Running Unit Tests'
echo '========================================================================='
npm run test
# to be safe, clear out any old libraries in the output directory
echo '========================================================================='
echo 'Cleaning out the old build artifacts'
echo '========================================================================='
rm -f android/viro_bridge/build/outputs/aar/*.aar
echo '========================================================================='
echo 'Building the React-Viro library'
echo '========================================================================='
cd android
./gradlew :viro_bridge:clean
./gradlew :viro_bridge:assembleRelease
cd ..
echo '========================================================================='
echo 'Checking for build artifacts'
echo '========================================================================='
if [ ! -f android/viro_bridge/build/outputs/aar/viro_bridge-release.aar ]; then
echo -e "Unable to find viro-bridge release output!"
exit
fi
echo '========================================================================='
echo 'Copying build artifacts to the lib directory'
echo '========================================================================='
rm -f android/react_viro/*.aar
cp android/viro_bridge/build/outputs/aar/viro_bridge-release.aar android/react_viro/react_viro-release.aar
echo '========================================================================='
echo 'Packing Tarball for NPM'
echo '========================================================================='
npm pack