diff options
author | Jason Wray <jason@mapbox.com> | 2019-07-25 16:04:35 -0700 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2019-07-30 13:58:30 -0700 |
commit | af32a452e08268cec7857246e2e2e2aecc0a1a1c (patch) | |
tree | 4a1f694e1b22f518c6afe7ba1051cedecd9c7d78 /platform | |
parent | 061bc59d1feb68132412913bb6412bc65f7c8c6b (diff) | |
download | qtlocation-mapboxgl-af32a452e08268cec7857246e2e2e2aecc0a1a1c.tar.gz |
[ios, build] Automatically deploy to CocoaPods
Diffstat (limited to 'platform')
-rwxr-xr-x | platform/ios/scripts/deploy-to-cocoapods.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/platform/ios/scripts/deploy-to-cocoapods.sh b/platform/ios/scripts/deploy-to-cocoapods.sh new file mode 100755 index 0000000000..27eb1fbabe --- /dev/null +++ b/platform/ios/scripts/deploy-to-cocoapods.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# This relies on either: +# 1. You being authenticated locally with CocoaPods trunk. +# 2. The `COCOAPODS_TRUNK_TOKEN` environment variable being set. + +set -euo pipefail + +function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; } +function finish { >&2 echo -en "\033[0m"; } +trap finish EXIT + +CIRCLE_TAG=${CIRCLE_TAG:-""} + +step "Pushing release to CocoaPods trunk…" + +if [[ $CIRCLE_TAG ]]; then + pod trunk push platform/ios/Mapbox-iOS-SDK.podspec --allow-warnings +else + echo "Skipping push to CocoaPods trunk for untagged build" +fi + +step "Pushing release/builds to Mapbox podspecs repo…" + +if [[ -z $(pod repo list | grep -i mapbox-public) ]]; then + pod repo add mapbox-public https://github.com/mapbox/pod-specs +else + echo "Found existing mapbox-public podspecs repo" +fi + +if [[ -z $(git config --global user.email) && $CI ]]; then + echo "Setting machine user as git committer" + git config --global user.email "MapboxCI@users.noreply.github.com" +fi + +if [[ $CIRCLE_TAG ]]; then + pod repo push mapbox-public platform/ios/Mapbox-iOS-SDK.podspec --allow-warnings + pod repo push mapbox-public platform/ios/Mapbox-iOS-SDK-stripped.podspec --allow-warnings +else + echo "Skipping push of release podspecs to mapbox-public for untagged build" + + # pod repo push mapbox-public platform/ios/Mapbox-iOS-SDK-snapshot-dynamic.podspec --allow-warnings + echo "Skipping push of snapshot to mapbox-public until we have a way to update the versions in the snapshot podspec" +fi |