summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2017-11-14 19:14:12 -0800
committerGitHub <noreply@github.com>2017-11-14 19:14:12 -0800
commit1049c012255520606ee349a16f6b430db74a520f (patch)
treea21eabfd16ea76fe0107ae76d2d9adccd0b6c5d9 /platform
parent739f88e61f3e004d372ee12a15b3ef4d2ca2c6e3 (diff)
downloadqtlocation-mapboxgl-1049c012255520606ee349a16f6b430db74a520f.tar.gz
Deploy macosapp as part of releases (#10191)
* [macos] Deploy macosapp as part of releases Added steps to the packaging script to archive and export macosapp. Upload the exported, compressed application bundle to the GitHub release when deploying a release. * [macos] Explicitly named function argument * [macos] Consolidated xcodebuild invocations
Diffstat (limited to 'platform')
-rw-r--r--platform/macos/ExportOptions.plist10
-rwxr-xr-xplatform/macos/scripts/deploy-packages.sh15
-rwxr-xr-xplatform/macos/scripts/package.sh24
3 files changed, 45 insertions, 4 deletions
diff --git a/platform/macos/ExportOptions.plist b/platform/macos/ExportOptions.plist
new file mode 100644
index 0000000000..21af10c08a
--- /dev/null
+++ b/platform/macos/ExportOptions.plist
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>method</key>
+ <string>developer-id</string>
+ <key>teamID</key>
+ <string>GJZR2MEM28</string>
+</dict>
+</plist>
diff --git a/platform/macos/scripts/deploy-packages.sh b/platform/macos/scripts/deploy-packages.sh
index d9d74b2867..90c3c29308 100755
--- a/platform/macos/scripts/deploy-packages.sh
+++ b/platform/macos/scripts/deploy-packages.sh
@@ -46,6 +46,19 @@ buildPackageStyle() {
--name ${file_name} \
--file "${BINARY_DIRECTORY}/${file_name}" > /dev/null
fi
+ if [[ ${DEPLOY_APP} == true ]]; then
+ cd build/macos/app
+ rm -f 'Mapbox GL.app.zip'
+ zip -yr '../deploy/Mapbox GL.app.zip' 'Mapbox GL.app'
+ cd -
+ if [[ "${GITHUB_RELEASE}" == true ]]; then
+ echo "Uploading ${file_name} to GitHub"
+ github-release upload \
+ --tag "macos-v${PUBLISH_VERSION}" \
+ --name ${file_name} \
+ --file "${BINARY_DIRECTORY}/${file_name}" > /dev/null
+ fi
+ fi
}
export TRAVIS_REPO_SLUG=mapbox-gl-native
@@ -114,6 +127,6 @@ if [[ "${GITHUB_RELEASE}" == true ]]; then
fi
buildPackageStyle "xpackage" "symbols"
-buildPackageStyle "xpackage SYMBOLS=NO"
+DEPLOY_APP=true buildPackageStyle "xpackage SYMBOLS=NO"
step "Finished deploying ${PUBLISH_VERSION} in $(($SECONDS / 60)) minutes and $(($SECONDS % 60)) seconds"
diff --git a/platform/macos/scripts/package.sh b/platform/macos/scripts/package.sh
index 6ae0cc65cc..a5aae24e0c 100755
--- a/platform/macos/scripts/package.sh
+++ b/platform/macos/scripts/package.sh
@@ -6,6 +6,7 @@ set -u
NAME=Mapbox
OUTPUT=build/macos/pkg
+APP_OUTPUT=build/macos/app
DERIVED_DATA=build/macos
PRODUCTS=${DERIVED_DATA}
@@ -16,13 +17,21 @@ function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
function finish { >&2 echo -en "\033[0m"; }
trap finish EXIT
-rm -rf ${OUTPUT}
+rm -rf ${OUTPUT} ${APP_OUTPUT}
HASH=`git log | head -1 | awk '{ print $2 }' | cut -c 1-10` && true
PROJ_VERSION=$(git rev-list --count HEAD)
SEM_VERSION=$( git describe --tags --match=macos-v*.*.* --abbrev=0 | sed 's/^macos-v//' )
SHORT_VERSION=${SEM_VERSION%-*}
+XCODEBUILD_SCHEME=dynamic
+XCODEBUILD_ACTION=build
+if [[ ${BUILDTYPE} == Release ]]; then
+ XCODEBUILD_SCHEME=macosapp
+ XCODEBUILD_ACTION=archive
+ mkdir -p ${APP_OUTPUT}
+fi
+
step "Building targets (build ${PROJ_VERSION}, version ${SEM_VERSION})…"
xcodebuild \
CURRENT_PROJECT_VERSION=${PROJ_VERSION} \
@@ -30,10 +39,12 @@ xcodebuild \
CURRENT_SEMANTIC_VERSION=${SEM_VERSION} \
CURRENT_COMMIT_HASH=${HASH} \
-derivedDataPath ${DERIVED_DATA} \
+ -archivePath "${APP_OUTPUT}/macosapp.xcarchive" \
-workspace ./platform/macos/macos.xcworkspace \
- -scheme dynamic \
+ -scheme ${XCODEBUILD_SCHEME} \
-configuration ${BUILDTYPE} \
- -jobs ${JOBS} | xcpretty
+ -jobs ${JOBS} \
+ ${XCODEBUILD_ACTION} | xcpretty
step "Copying dynamic framework into place"
mkdir -p "${OUTPUT}/${NAME}.framework"
@@ -66,6 +77,13 @@ if [[ ${BUILDTYPE} == Release ]]; then
validate_dsym \
"${OUTPUT}/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}" \
"${OUTPUT}/${NAME}.framework/${NAME}"
+
+ step "Exporting Mapbox GL.app"
+ xcodebuild \
+ -exportArchive \
+ -archivePath "${APP_OUTPUT}/macosapp.xcarchive" \
+ -exportPath "${APP_OUTPUT}" \
+ -exportOptionsPlist platform/macos/ExportOptions.plist
fi
function create_podspec {