Add AdMob adapter to release pipeline (#6486)

* ci: add revenuecat-admob-tests to merge-blocking CI gates

* ci: add deploy script for RevenueCatAdMob adapter

* ci: switch AdMob adapter SPM dependency to purchases-ios-spm

Use the lightweight purchases-ios-spm mirror instead of the full
purchases-ios repo for faster dependency resolution. Also ensures
deploy-to-spm completes before the AdMob adapter is published.

* docs: note purchases-ios-spm dependency requirement in AdMob adapter README

* fix: address review — add Examples/ to .gitignore and simplify rsync

* fix: address review — flip --live-run to --dry-run for consistency

* fix: replace rsync with cp -a in deploy script

rsync is not available in cimg/base:stable Docker image.
cp -a achieves the same recursive copy with preserved attributes.

* ci: test AdMob adapter deploy with hardcoded version 5.66.0

Temporarily hardcode version and simplify deploy-tag workflow to test
the deploy-to-purchases-ios-admob job from the release-admob-adapter branch.

* Revert "ci: test AdMob adapter deploy with hardcoded version 5.66.0"

This reverts commit 104542f0ab0a0dbb590b19187f8e598ca8ece96c.
This commit is contained in:
Pol Miro authored and GitHub committed 2026-03-23 09:34:34 +01:00
1 parent df7f6e2812
commit e1e9c7d190
5 files changed
+83 -23

No files matched your search

+19
View File
@@ -2010,6 +2010,18 @@ jobs:
git push origin
git push --tags
deploy-to-purchases-ios-admob:
docker:
- image: cimg/base:stable
resource_class: small
steps:
- checkout
- revenuecat/setup-git-credentials
- revenuecat/trust-github-key
- run:
name: Deploy RevenueCatAdMob to purchases-ios-admob
command: ci_scripts/deploy-admob-spm.sh "${CIRCLE_TAG}"
bump-sdk-in-rc-mobile-app:
docker:
- image: cimg/ruby:3.2.0
@@ -2290,6 +2302,7 @@ workflows:
- installation-tests-carthage
- api-tests
- spm-receipt-parser
- revenuecat-admob-tests
- deploy-purchase-tester
- run-all-maestro-e2e-tests
- docs-build
@@ -2307,6 +2320,10 @@ workflows:
<<: *release-tags
- deploy-to-spm:
<<: *release-tags
- deploy-to-purchases-ios-admob:
requires:
- deploy-to-spm
<<: *release-tags
- docs-deploy:
<<: *release-tags
- deploy-purchase-tester:
@@ -2316,6 +2333,7 @@ workflows:
requires:
- push-revenuecatui-pod
- deploy-to-spm
- deploy-to-purchases-ios-admob
- docs-deploy
- deploy-purchase-tester
<<: *release-tags
@@ -2577,6 +2595,7 @@ workflows:
- installation-tests-all-but-carthage
- installation-tests-carthage
- api-tests
- revenuecat-admob-tests
- deploy-purchase-tester
- emerge_binary_size_analysis
+6
View File
@@ -0,0 +1,6 @@
Package.resolved
.build/
.swiftpm/
*.xcodeproj/
Derived/
Examples/
@@ -1,23 +0,0 @@
{
"pins" : [
{
"identity" : "swift-package-manager-google-mobile-ads",
"kind" : "remoteSourceControl",
"location" : "https://github.com/googleads/swift-package-manager-google-mobile-ads.git",
"state" : {
"revision" : "4458cfaeb502801c779dbb7fbd0121d198628f52",
"version" : "13.1.0"
}
},
{
"identity" : "swift-package-manager-google-user-messaging-platform",
"kind" : "remoteSourceControl",
"location" : "https://github.com/googleads/swift-package-manager-google-user-messaging-platform.git",
"state" : {
"revision" : "13b248eaa73b7826f0efb1bcf455e251d65ecb1b",
"version" : "3.1.0"
}
}
],
"version" : 2
}
+2
View File
@@ -12,6 +12,8 @@ The adapter is a **standalone Swift package** under `AdapterSDKs/RevenueCatAdMob
```
Then add the `RevenueCatAdMob` product to your target.
> **Note:** If your project depends on RevenueCat via SPM, use the [`purchases-ios-spm`](https://github.com/RevenueCat/purchases-ios-spm) package (not `purchases-ios`). The adapter's published package already declares this dependency correctly, but if you add RevenueCat separately, make sure both resolve from the same `purchases-ios-spm` repository to avoid duplicate package errors.
- **Swift Package Manager (local development):** To use the adapter from a local checkout of this repo, add the package by path to the `AdapterSDKs/RevenueCatAdMob` directory:
```swift
.package(path: "path/to/purchases-ios/AdapterSDKs/RevenueCatAdMob")
+56
View File
@@ -0,0 +1,56 @@
#!/bin/bash
set -euo pipefail
# Deploys the RevenueCatAdMob adapter to the purchases-ios-admob SPM repo.
# Rewrites the local path dependency to a versioned dependency, then commits, tags, and pushes.
#
# Usage:
# ci_scripts/deploy-admob-spm.sh <version> # commits, tags, and pushes
# ci_scripts/deploy-admob-spm.sh <version> --dry-run # preview changes without pushing
VERSION="${1:?Usage: deploy-admob-spm.sh <version> [--dry-run]}"
DRY_RUN="${2:-}"
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
ADAPTER_DIR="${REPO_ROOT}/AdapterSDKs/RevenueCatAdMob"
WORK_DIR="$(mktemp -d)"
if [ "${DRY_RUN}" != "--dry-run" ]; then
trap 'rm -rf "${WORK_DIR}"' EXIT
fi
# Clone the target repo
git clone git@github.com:RevenueCat/purchases-ios-admob.git "${WORK_DIR}"
cd "${WORK_DIR}"
# Clear existing contents (except .git)
git rm -rf . 2>/dev/null || true
# Copy adapter sources
cp -a "${ADAPTER_DIR}/." .
# Rewrite Package.swift: replace local path dep with versioned dep
# sed -i behaves differently on macOS (requires '') vs Linux (no argument)
if [[ "$(uname)" == "Darwin" ]]; then
sed -i '' 's|.package(name: "purchases-ios", path: "../..")|.package(url: "https://github.com/RevenueCat/purchases-ios-spm.git", exact: "'"${VERSION}"'")|' Package.swift
sed -i '' 's|package: "purchases-ios"|package: "purchases-ios-spm"|' Package.swift
else
sed -i 's|.package(name: "purchases-ios", path: "../..")|.package(url: "https://github.com/RevenueCat/purchases-ios-spm.git", exact: "'"${VERSION}"'")|' Package.swift
sed -i 's|package: "purchases-ios"|package: "purchases-ios-spm"|' Package.swift
fi
if [ "${DRY_RUN}" = "--dry-run" ]; then
echo "=== Dry run: showing rewritten Package.swift ==="
cat Package.swift
echo ""
echo "=== Files that would be committed ==="
git add -A
git status
echo "=== Dry run complete — remove --dry-run to push ==="
echo "=== Work dir kept at: ${WORK_DIR} ==="
else
git add -A
git commit -m "Release ${VERSION}"
git tag "${VERSION}"
git push origin main
git push origin "${VERSION}"
fi