summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@codesorcery.net>2015-04-06 16:42:32 -0700
committerJustin R. Miller <incanus@codesorcery.net>2015-04-06 16:42:32 -0700
commit0d60add8ebc677eafdaf281aeac38c68e1126260 (patch)
tree7d236bffff020967751f9082fb83d2957c94b586
parent760c0f0f19aa00bdec063556d76ba5cceb150e93 (diff)
downloadqtlocation-mapboxgl-0d60add8ebc677eafdaf281aeac38c68e1126260.tar.gz
fixes #1189, #880: split OS X/iOS builds & deploy iOS to S3
-rw-r--r--.travis.yml5
-rw-r--r--Makefile3
-rwxr-xr-xscripts/deploy_ios.sh26
-rwxr-xr-xscripts/travis_script.sh25
4 files changed, 51 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml
index e3c541c865..690b2b1b67 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 4c830fd83f..ecf5407326 100644
--- a/Makefile
+++ b/Makefile
@@ -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: Xcode/ios
+ ./scripts/package_ios.sh
+
# Legacy name
iproj: ios-proj
diff --git a/scripts/deploy_ios.sh b/scripts/deploy_ios.sh
new file mode 100755
index 0000000000..15d935abd8
--- /dev/null
+++ b/scripts/deploy_ios.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+set -u
+
+#
+# iOS release tag format is `ios-vX.Y.Z`
+#
+PUBLISH_VERSION="$1"
+
+#
+# build
+#
+cd ..
+./scripts/package_ios.sh
+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 --recursive > /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 45bda62c37..6c2ef672dd 100755
--- a/scripts/travis_script.sh
+++ b/scripts/travis_script.sh
@@ -3,6 +3,11 @@
set -e
set -o pipefail
+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 '-' '{ print $1 }')
+PUBLISH_VERSION=$(echo "$PUBLISH_TAG" | awk -F '-v' '{ print $2 }')
+
mapbox_time "checkout_styles" \
git submodule update --init styles
@@ -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 & package iOS
#
- # build iOS
+ mapbox_time "package_ios"
+ make ipackage
#
- mapbox_time "build_ios_project_device_release" \
- make ios -j$JOBS
- mapbox_time "build_ios_project_simulator_debug" \
- make isim -j$JOBS
+ # conditionally deploy iOS build
+ #
+ if [[ -n "$PUBLISH_TAG" ]]; then
+ mapbox_time "deploy_ios"
+ ./scripts/deploy_ios.sh "$PUBLISH_VERSION"
+ fi
fi