diff options
Diffstat (limited to 'platform/ios/scripts/publish-cn.sh')
-rwxr-xr-x | platform/ios/scripts/publish-cn.sh | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/platform/ios/scripts/publish-cn.sh b/platform/ios/scripts/publish-cn.sh new file mode 100755 index 0000000000..b340a1b217 --- /dev/null +++ b/platform/ios/scripts/publish-cn.sh @@ -0,0 +1,53 @@ + +#!/usr/bin/env bash + +set -e +set -o pipefail +set -u + +function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; } +function finish { >&2 echo -en "\033[0m"; } +trap finish EXIT + +# +# make the framework +# + +step "Make the framework" +export BUILDTYPE=Release +./platform/ios/scripts/package.sh +echo "making package" +wait +echo "finished!" + +# +# zip +# +cd build/ios/pkg +ZIP="mapbox-ios-sdk-4.5.0-cn.1.zip" +step "Compressing ${ZIP}…" +rm -f ../${ZIP} +zip -yr ../${ZIP} * + +# +# report file sizes +# +step "Echoing file sizes…" +du -sh ../${ZIP} +du -sch * +du -sch dynamic/* + +# +# upload +# +PROGRESS= +if [ -n "${CI:-}" ]; then + PROGRESS="--no-progress" +fi + +step "Uploading ${ZIP} to s3…" + +# Since this build is primarily for .CN customers, it will be hosted on .cn. + +aws s3 cp ../${ZIP} s3://binary.mapbox.cn/ios/builds/maps-sdk/ --acl public-read ${PROGRESS} +echo "URL: https://s3.cn-north-1.amazonaws.com.cn/binary.mapbox.cn/ios/builds/maps-sdk/${ZIP}" |