summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2019-07-25 16:04:35 -0700
committerJason Wray <jason@mapbox.com>2019-07-26 16:39:12 -0700
commitcab30d0991f0c119bcd51939f24520e4fac58c2e (patch)
treed74f59d1d07de772e40c48b114314c7251fe685d
parentac407c673403f2e191884655b28beff617fc47b5 (diff)
downloadqtlocation-mapboxgl-upstream/friedbunny-automates-cocoapods-pushes.tar.gz
[ios, build] Automatically deploy to CocoaPodsupstream/friedbunny-automates-cocoapods-pushes
-rw-r--r--circle.yml14
-rwxr-xr-xplatform/ios/scripts/deploy-to-cocoapods.sh38
2 files changed, 52 insertions, 0 deletions
diff --git a/circle.yml b/circle.yml
index ba624dc251..1cc69000bf 100644
--- a/circle.yml
+++ b/circle.yml
@@ -1072,9 +1072,18 @@ jobs:
if [[ $CIRCLE_BRANCH == master ]]; then
platform/ios/scripts/deploy-snapshot.sh
fi
+ background: true
+ - deploy:
+ name: Deploy to Mapbox CocoaPods spec repo
+ command: |
+ if [[ $CIRCLE_BRANCH == master ]]; then
+ platform/ios/scripts/deploy-to-cocoapods.sh
+ fi
+ background: true
- run:
name: Record size
command: platform/ios/scripts/metrics.sh
+ background: true
- run:
name: Trigger metrics
command: |
@@ -1085,6 +1094,7 @@ jobs:
echo "MOBILE_METRICS_TOKEN not provided"
fi
fi
+ background: true
- save-dependencies
- collect-xcode-build-logs
- upload-xcode-build-logs
@@ -1122,6 +1132,10 @@ jobs:
export VERSION_TAG=${CIRCLE_TAG}
export GITHUB_TOKEN=${DANGER_GITHUB_API_TOKEN}
platform/ios/scripts/deploy-packages.sh
+ - deploy:
+ name: Deploy to CocoaPods
+ command: platform/ios/scripts/deploy-to-cocoapods.sh
+ background: true
- save-dependencies
- collect-xcode-build-logs
- upload-xcode-build-logs
diff --git a/platform/ios/scripts/deploy-to-cocoapods.sh b/platform/ios/scripts/deploy-to-cocoapods.sh
new file mode 100755
index 0000000000..07c63d4cfb
--- /dev/null
+++ b/platform/ios/scripts/deploy-to-cocoapods.sh
@@ -0,0 +1,38 @@
+#!/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 [[ $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