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
This commit is contained in:
10
platform/macos/ExportOptions.plist
Normal file
10
platform/macos/ExportOptions.plist
Normal file
@@ -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>
|
||||
@@ -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"
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user