Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
fixes #1189, #880: split OS X/iOS builds & deploy iOS to S3
Browse files Browse the repository at this point in the history
  • Loading branch information
incanus committed Apr 6, 2015
1 parent 760c0f0 commit 0d60add
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
26 changes: 26 additions & 0 deletions scripts/deploy_ios.sh
Original file line number Diff line number Diff line change
@@ -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}
25 changes: 18 additions & 7 deletions scripts/travis_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit 0d60add

Please sign in to comment.