From 177c0473165aacb26bea9efb6441ab99756c218a Mon Sep 17 00:00:00 2001 From: Jordan Kiley Date: Thu, 6 Dec 2018 16:29:48 -0800 Subject: [ios] Release iOS 8-compatible branch via CircleCI (#13480) --- circle.yml | 3 +- platform/ios/scripts/deploy-packages-cn.sh | 51 ++++++++++++++++++++++++++++++ platform/ios/scripts/publish-cn.sh | 14 +++++++- 3 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 platform/ios/scripts/deploy-packages-cn.sh diff --git a/circle.yml b/circle.yml index 087418de3..efdd07aaa 100644 --- a/circle.yml +++ b/circle.yml @@ -972,8 +972,7 @@ jobs: name: Build, package, and upload iOS release command: | export VERSION_TAG=${CIRCLE_TAG} - export GITHUB_TOKEN=${DANGER_GITHUB_API_TOKEN} - platform/ios/scripts/deploy-packages.sh + platform/ios/scripts/deploy-packages-cn.sh - save-dependencies - collect-xcode-build-logs - upload-xcode-build-logs diff --git a/platform/ios/scripts/deploy-packages-cn.sh b/platform/ios/scripts/deploy-packages-cn.sh new file mode 100644 index 000000000..82894ae74 --- /dev/null +++ b/platform/ios/scripts/deploy-packages-cn.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail +set -u + +# dynamic environment variables: +# VERSION_TAG={determined automatically}: Version tag in format ios-vX.X.X-pre.X +# GITHUB_RELEASE=true: Upload to github +# BINARY_DIRECTORY=build/ios/deploy: Directory in which to save test packages + +# environment variables and dependencies: +# - You must run "mbx auth ..." before running +# - Set GITHUB_TOKEN to a GitHub API access token in your environment to use GITHUB_RELEASE +# - "wget" is required for downloading the zip files from s3 +# - The "github-release" command is required to use GITHUB_RELEASE + +function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; } +function finish { >&2 echo -en "\033[0m"; } +trap finish EXIT + +buildPackageStyle() { + local package=$1 style="" + if [[ ${#} -eq 2 ]]; then + style="$2" + fi + step "Building: make ${package} ${style}" + make ${package} + step "Publishing ${package} with ${style}" + local file_name="" + if [ -z ${style} ] + then + ./platform/ios/scripts/publish-cn.sh "${PUBLISH_VERSION}" + file_name=mapbox-ios-sdk-${PUBLISH_VERSION}.zip + else + ./platform/ios/scripts/publish-cn.sh "${PUBLISH_VERSION}" ${style} + file_name=mapbox-ios-sdk-${PUBLISH_VERSION}-${style}.zip + fi +PUBLISH_VERSION=$( echo ${VERSION_TAG} | sed 's/^ios-v//' ) +git checkout ${VERSION_TAG} + +step "Deploying version ${PUBLISH_VERSION}…" +# +make clean && make distclean +npm install --ignore-scripts +mkdir -p ${BINARY_DIRECTORY} + +buildPackageStyle "iframework" "symbols-dynamic" +buildPackageStyle "iframework SYMBOLS=NO" "dynamic" + +step "Finished deploying ${PUBLISH_VERSION} in $(($SECONDS / 60)) minutes and $(($SECONDS % 60)) seconds" diff --git a/platform/ios/scripts/publish-cn.sh b/platform/ios/scripts/publish-cn.sh index b340a1b21..a0cbdca02 100755 --- a/platform/ios/scripts/publish-cn.sh +++ b/platform/ios/scripts/publish-cn.sh @@ -9,6 +9,18 @@ function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; } function finish { >&2 echo -en "\033[0m"; } trap finish EXIT +# +# iOS 8-compatible release tag format is `vX.Y.Z-cn.1`; `X.Y.Z-cn.1` 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 + # # make the framework # @@ -24,7 +36,7 @@ echo "finished!" # zip # cd build/ios/pkg -ZIP="mapbox-ios-sdk-4.5.0-cn.1.zip" +ZIP="mapbox-ios-sdk-${PUBLISH_VERSION}.zip" step "Compressing ${ZIP}…" rm -f ../${ZIP} zip -yr ../${ZIP} * -- cgit v1.2.3