From 4e86e2c62a31d855f403aeb01e91fdd7dd9fd5eb Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 6 Apr 2015 22:33:40 -0700 Subject: [PATCH 1/4] fixes #1189, #880: split OS X/iOS builds & deploy iOS to S3 --- .travis.yml | 5 ++++- Makefile | 5 ++++- scripts/publish_ios.sh | 24 ++++++++++++++++++++++++ scripts/travis_script.sh | 25 ++++++++++++++++++------- 4 files changed, 50 insertions(+), 9 deletions(-) create mode 100755 scripts/publish_ios.sh diff --git a/.travis.yml b/.travis.yml index e3c541c86..690b2b1b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,10 @@ matrix: env: BUILDTYPE=Release JOBS=8 compiler: gcc - os: osx - env: BUILDTYPE=Debug JOBS=8 + env: BUILDTYPE=Debug JOBS=8 MASON_PLATFORM=osx + compiler: clang + - os: osx + env: BUILDTYPE=Release JOBS=8 MASON_PLATFORM=ios compiler: clang env: diff --git a/Makefile b/Makefile index 4c830fd83..e0d5102d5 100644 --- a/Makefile +++ b/Makefile @@ -114,7 +114,7 @@ xproj: xosx-proj Xcode/ios: ios/app/mapboxgl-app.gyp config/ios.gypi styles/styles SMCalloutView deps/run_gyp ios/app/mapboxgl-app.gyp $(CONFIG_ios) $(LIBS_ios) --generator-output=./build/ios -f xcode -.PHONY: ios-proj ios run-ios +.PHONY: ios-proj ios isim ipackage ios-proj: Xcode/ios open ./build/ios/ios/app/mapboxgl-app.xcodeproj @@ -124,6 +124,9 @@ ios: Xcode/ios isim: Xcode/ios xcodebuild -sdk iphonesimulator ARCHS="x86_64 i386" -project ./build/ios/ios/app/mapboxgl-app.xcodeproj -configuration Debug -target iosapp -jobs $(JOBS) +ipackage: clean Xcode/ios + ./scripts/package_ios.sh + # Legacy name iproj: ios-proj diff --git a/scripts/publish_ios.sh b/scripts/publish_ios.sh new file mode 100755 index 000000000..f65f3e560 --- /dev/null +++ b/scripts/publish_ios.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail +set -u + +# +# iOS release tag format is `ios-vX.Y.Z`; `X.Y.Z` gets passed in +# +PUBLISH_VERSION="$1" + +# +# zip +# +cd build/ios/pkg/static +ZIP=mapbox-gl-ios-${PUBLISH_VERSION}.zip +rm -f ../${ZIP} +zip -r ../${ZIP} * +# +# upload +# +REPO_NAME=$(basename $TRAVIS_REPO_SLUG) +aws s3 cp ../${ZIP} s3://mapbox/$REPO_NAME/ios/builds/ --acl public-read > /dev/null +echo http://mapbox.s3.amazonaws.com/$REPO_NAME/ios/builds/${ZIP} diff --git a/scripts/travis_script.sh b/scripts/travis_script.sh index 45bda62c3..0351f9414 100755 --- a/scripts/travis_script.sh +++ b/scripts/travis_script.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +COMMIT_MESSAGE=$(git show -s --format=%B $1 | tr -d '\n') +PUBLISH_TAG=$(echo "$COMMIT_MESSAGE" | grep -oE '\[publish [a-z0-9\.\-]+\]' | grep -oE '[a-z0-9\.\-]+' | tail -n1) +PUBLISH_PLATFORM=$(echo "$PUBLISH_TAG" | awk -F '-v' '{ print $1 }') +PUBLISH_VERSION=$(echo "$PUBLISH_TAG" | awk -F '-v' '{ print $2 }') + set -e set -o pipefail @@ -34,18 +39,24 @@ elif [[ ${TRAVIS_OS_NAME} == "linux" ]]; then mapbox_time_finish fi -elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then +elif [[ ${TRAVIS_OS_NAME} == "osx" && ${MASON_PLATFORM} == "osx" ]]; then # # build OS X # - mapbox_time "build_osx_project" \ + mapbox_time "build_osx" \ make xosx -j$JOBS +elif [[ ${TRAVIS_OS_NAME} == "osx" && ${MASON_PLATFORM} == "ios" ]]; then # - # build iOS + # build & package iOS # - mapbox_time "build_ios_project_device_release" \ - make ios -j$JOBS - mapbox_time "build_ios_project_simulator_debug" \ - make isim -j$JOBS + mapbox_time "package_ios" + make ipackage + # + # conditionally deploy iOS build + # + if [[ -n "$PUBLISH_TAG" ]]; then + mapbox_time "deploy_ios" + ./scripts/publish_ios.sh "$PUBLISH_VERSION" + fi fi From e4228f7a0f7508b387bbce9f0e29c0254d42a6de Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Tue, 7 Apr 2015 11:18:52 -0700 Subject: [PATCH 2/4] prep CocoaPods for new deploy setup --- ios/MapboxGL.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/MapboxGL.podspec b/ios/MapboxGL.podspec index b474f7c9e..da3cd7df6 100644 --- a/ios/MapboxGL.podspec +++ b/ios/MapboxGL.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'MapboxGL' - m.version = '0.1.0' + m.version = '0.2.8' m.summary = 'Open source vector map solution for iOS with full styling capabilities.' m.description = 'Open source OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa bindings.' @@ -11,7 +11,7 @@ Pod::Spec.new do |m| m.screenshot = 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/master/ios/screenshot.png' m.social_media_url = 'https://twitter.com/mapbox' - m.source = { :http => "http://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/mapbox-gl-ios-#{m.version.to_s}.zip" } + m.source = { :http => "http://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/builds/mapbox-gl-ios-#{m.version.to_s}.zip" } m.platform = :ios m.ios.deployment_target = '7.0' From 6efbda6755de9d6dd57a57efcca416c32d961dd4 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Tue, 7 Apr 2015 11:19:49 -0700 Subject: [PATCH 3/4] [publish ios-v0.2.8] From 778925a96a3fbbc936ff4ae16c926e8df35ed0e4 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Tue, 7 Apr 2015 13:05:38 -0700 Subject: [PATCH 4/4] refs #1219: move iOS CocoaPods spec to root of project This is only temporary, until such time that we release Mapbox GL on CocoaPods directly, when they will host the Podspec. For now, it needs to be in the repository root to be usable as a non-main CocoaPods source. --- ios/MapboxGL.podspec => MapboxGL.podspec | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ios/MapboxGL.podspec => MapboxGL.podspec (100%) diff --git a/ios/MapboxGL.podspec b/MapboxGL.podspec similarity index 100% rename from ios/MapboxGL.podspec rename to MapboxGL.podspec