summaryrefslogtreecommitdiff
path: root/platform/ios/scripts/publish-cn.sh
blob: f664042445770f2226ed0766d1bb60ac6ad8319e (plain)
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

#!/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-${PUBLISH_VERSION}.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}"