From a3b02c2870219ffb12b2be42e5b595460ae8b1db Mon Sep 17 00:00:00 2001 From: Jordan Kiley Date: Tue, 6 Nov 2018 17:43:38 -0800 Subject: Modify publish.sh and Podspecs for iOS 8 branch (#13165) --- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 4 +-- platform/ios/Mapbox-iOS-SDK.podspec | 4 +-- platform/ios/Release-CN.md | 16 +++++++++ platform/ios/scripts/document.sh | 4 +-- platform/ios/scripts/package.sh | 13 +++---- platform/ios/scripts/publish-cn.sh | 53 +++++++++++++++++++++++++++++ 6 files changed, 80 insertions(+), 14 deletions(-) create mode 100644 platform/ios/Release-CN.md create mode 100755 platform/ios/scripts/publish-cn.sh diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index 75e0f3ffee..825629dc10 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '4.5.0' + version = '4.5.0-cn.1' m.name = 'Mapbox-iOS-SDK-symbols' m.version = "#{version}-symbols" @@ -15,7 +15,7 @@ Pod::Spec.new do |m| m.documentation_url = 'https://www.mapbox.com/ios-sdk/api/' m.source = { - :http => "https://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/builds/mapbox-ios-sdk-#{m.version.to_s}-dynamic.zip", + :http => "https://s3.cn-north-1.amazonaws.com.cn/binary.mapbox.cn/mapbox-ios-sdk-#{m.version.to_s}-dynamic.zip", :flatten => true } diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index fd7dca1d2e..c521dc40ac 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '4.5.0' + version = '4.5.0-cn.1' m.name = 'Mapbox-iOS-SDK' m.version = version @@ -15,7 +15,7 @@ Pod::Spec.new do |m| m.documentation_url = 'https://www.mapbox.com/ios-sdk/api/' m.source = { - :http => "https://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/builds/mapbox-ios-sdk-#{m.version.to_s}-dynamic.zip", + :http => "https://s3.cn-north-1.amazonaws.com.cn/binary.mapbox.cn/mapbox-ios-sdk-#{m.version.to_s}-dynamic.zip", :flatten => true } diff --git a/platform/ios/Release-CN.md b/platform/ios/Release-CN.md new file mode 100644 index 0000000000..c1ed008b82 --- /dev/null +++ b/platform/ios/Release-CN.md @@ -0,0 +1,16 @@ +### Release `ios8-release-gazpacho` + +This branch is intended to exist as a branch off of of the main Maps SDK. There are no plans to bring this branch back into `master`. If this branch is updated to incorporate new release branches in the future, please update the branch name. + +Before running this script, please check that you are authorized to upload to S3 in China. + +1. Update the `SEM_VERSION` value in the `platform/ios/scripts/package.sh` file. Versioning will follow: `vX.X.X-cn.X` in order to keep this distinct from the main Maps SDK. + +2. Update the SDK version in the podspec files. + +3. Update the `RELEASE_VERSION` and `SHORT_VERSION` in `platform/ios/scripts/documentation.sh`. + +4. Run `platform/ios/scripts/publish-cn.sh`. This: + - Builds `Mapbox.framework` and a companion dSYM file. + - Generates documentation. + - Uploads a .zip file containing the framework and documentation to S3 China. \ No newline at end of file diff --git a/platform/ios/scripts/document.sh b/platform/ios/scripts/document.sh index 99c8967aa1..e130e75a67 100755 --- a/platform/ios/scripts/document.sh +++ b/platform/ios/scripts/document.sh @@ -27,8 +27,8 @@ fi OUTPUT=${OUTPUT:-documentation} BRANCH=$( git describe --tags --match=ios-v*.*.* --abbrev=0 ) -SHORT_VERSION=$( echo ${BRANCH} | sed 's/^ios-v//' ) -RELEASE_VERSION=$( echo ${SHORT_VERSION} | sed -e 's/^ios-v//' -e 's/-.*//' ) +SHORT_VERSION="4.5.0-cn.1" +RELEASE_VERSION="4.5.0-cn.1" rm -rf /tmp/mbgl mkdir -p /tmp/mbgl/ diff --git a/platform/ios/scripts/package.sh b/platform/ios/scripts/package.sh index 2506540910..61a052780e 100755 --- a/platform/ios/scripts/package.sh +++ b/platform/ios/scripts/package.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash -set -e +set -eu set -o pipefail -set -u NAME=Mapbox OUTPUT=build/ios/pkg @@ -10,7 +9,7 @@ DERIVED_DATA=build/ios PRODUCTS=${DERIVED_DATA} LOG_PATH=build/xcodebuild-$(date +"%Y-%m-%d_%H%M%S").log -BUILDTYPE=${BUILDTYPE:-Debug} +BUILDTYPE=${BUILDTYPE:-Release} BUILD_FOR_DEVICE=${BUILD_DEVICE:-true} SYMBOLS=${SYMBOLS:-YES} @@ -56,7 +55,7 @@ echo ${HASH} echo ${HASH} >> ${VERSION} PROJ_VERSION=$(git rev-list --count HEAD) -SEM_VERSION=$( git describe --tags --match=ios-v*.*.* --abbrev=0 | sed 's/^ios-v//' ) +SEM_VERSION="4.5.0-cn.1" SHORT_VERSION=${SEM_VERSION%-*} step "Building targets (build ${PROJ_VERSION}, version ${SEM_VERSION})" @@ -77,8 +76,7 @@ xcodebuild \ -workspace ./platform/ios/ios.xcworkspace \ -scheme ${SCHEME} \ -configuration ${BUILDTYPE} \ - -sdk iphonesimulator \ - -jobs ${JOBS} | tee ${LOG_PATH} | xcpretty + -sdk iphonesimulator | tee ${LOG_PATH} | xcpretty if [[ ${BUILD_FOR_DEVICE} == true ]]; then step "Building ${FORMAT} framework for iOS devices using ${SCHEME} scheme" @@ -92,8 +90,7 @@ if [[ ${BUILD_FOR_DEVICE} == true ]]; then -workspace ./platform/ios/ios.xcworkspace \ -scheme ${SCHEME} \ -configuration ${BUILDTYPE} \ - -sdk iphoneos \ - -jobs ${JOBS} | tee ${LOG_PATH} | xcpretty + -sdk iphoneos | tee ${LOG_PATH} | xcpretty fi LIBS=(Mapbox.a) 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}" -- cgit v1.2.1