-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathrelease-sdk.sh
executable file
·33 lines (28 loc) · 1.26 KB
/
release-sdk.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
exit_with_failure()
# Copyright (c) Meta Platforms, Inc. and affiliates.
{
echo "❌ $*" 1>&2 ; exit 1;
}
SDK_VERSION=$1
[[ -n "$SDK_VERSION" ]] || exit_with_failure "No version passed as first argument"
if [[ -z "$CI" ]] ; then
echo "⚠️ It appears you're running this script on your own machine."
echo "⚠️ Be aware that the created ZIP file will include files ignored by git,"
echo "⚠️ such as build artifacts, in the examples."
echo "⚠️ To avoid this, either run this script on a fresh git clone, or clean"
echo "⚠️ the examples directory with 'git clean -dxf --dry-run examples/'."
fi
echo "Cleaning release directory"
rm -rf release/
sh build-platform.sh ios || exit_with_failure "Building for iOS failed"
sh build-platform.sh android || exit_with_failure "Building for Android failed"
# Zip everything up and put the result in a new 'release/' directory
mkdir -p release
zip --verbose --recurse-paths -X "release/sdk-$SDK_VERSION.zip" \
examples/android/LofeltHapticsExamplePreAuthored/ \
examples/ios/LofeltHapticsExamplePreAuthored/ \
ios-framework/ \
android-library/ \
licenses/ \
--exclude "*.gitignore" --exclude "*DS_Store" --exclude "*.template" \
|| exit_with_failure "Creating .zip failed"