diff options
author | jmkiley <jordan.kiley@mapbox.com> | 2018-10-25 23:00:01 +0800 |
---|---|---|
committer | jmkiley <jordan.kiley@mapbox.com> | 2018-10-25 23:00:01 +0800 |
commit | e3f88c4668c2e97afbfd29d087fb8c3630439e1b (patch) | |
tree | 972a59e226d96c8d522a7dc0968b4340358747e3 | |
parent | 500038dbfe5469d30721cb8e096a5249427730a3 (diff) | |
download | qtlocation-mapboxgl-e3f88c4668c2e97afbfd29d087fb8c3630439e1b.tar.gz |
[ios] moved publish script to separate file
-rw-r--r-- | platform/ios/scripts/publish-cn.sh | 42 | ||||
-rwxr-xr-x | platform/ios/scripts/publish.sh | 31 |
2 files changed, 68 insertions, 5 deletions
diff --git a/platform/ios/scripts/publish-cn.sh b/platform/ios/scripts/publish-cn.sh new file mode 100644 index 0000000000..0cd6d0ea01 --- /dev/null +++ b/platform/ios/scripts/publish-cn.sh @@ -0,0 +1,42 @@ + +#!/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 + +# +# zip +# +cd build/ios/pkg +ZIP="mapbox-ios-sdk-cn.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://mapbox.s3.amazonaws.cn/ios/builds/maps-sdk/${ZIP}" diff --git a/platform/ios/scripts/publish.sh b/platform/ios/scripts/publish.sh index 0c42666344..3212449aa5 100755 --- a/platform/ios/scripts/publish.sh +++ b/platform/ios/scripts/publish.sh @@ -9,10 +9,22 @@ function finish { >&2 echo -en "\033[0m"; } trap finish EXIT # +# iOS release tag format is `vX.Y.Z`; `X.Y.Z` gets passed in +# In the case of symbolicated builds, we also append the `-symbols`. +# +PUBLISH_VERSION="$1" + +if [[ ${#} -eq 2 ]]; then + PUBLISH_STYLE="-$2" +else + PUBLISH_STYLE="" +fi + +# # zip # cd build/ios/pkg -ZIP="mapbox-ios-sdk-cn.zip" +ZIP="mapbox-ios-sdk-${PUBLISH_VERSION}${PUBLISH_STYLE}.zip" step "Compressing ${ZIP}…" rm -f ../${ZIP} zip -yr ../${ZIP} * @@ -34,8 +46,17 @@ if [ -n "${CI:-}" ]; then fi step "Uploading ${ZIP} to s3…" +REPO_NAME=$(basename $TRAVIS_REPO_SLUG) +aws s3 cp ../${ZIP} s3://mapbox/$REPO_NAME/ios/builds/ --acl public-read ${PROGRESS} +echo "URL: https://mapbox.s3.amazonaws.com/$REPO_NAME/ios/builds/${ZIP}" -# 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://mapbox.s3.amazonaws.cn/ios/builds/maps-sdk/${ZIP}" +# +# upload & update nightly +# +if [[ ${PUBLISH_VERSION} =~ "nightly" ]]; then + step "Updating ${PUBLISH_VERSION} to ${PUBLISH_STYLE}…" + GENERIC_NIGHTLY_FILENAME="mapbox-ios-sdk-${PUBLISH_VERSION}.zip" + aws s3 cp \ + s3://mapbox/$REPO_NAME/ios/builds/${ZIP} \ + s3://mapbox/$REPO_NAME/ios/builds/${GENERIC_NIGHTLY_FILENAME} --acl public-read ${PROGRESS} +fi |