File tree Expand file tree Collapse file tree
actions/wait-for-cocoapods-pod Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : ' Wait for OneSignal iOS SDK on CocoaPods'
2+ description : ' Poll CocoaPods CDN until OneSignalXCFramework:<version> is published. Useful in release workflows that race podspec publication.'
3+
4+ inputs :
5+ version :
6+ description : ' OneSignal iOS SDK version to wait for'
7+ required : true
8+
9+ runs :
10+ using : composite
11+ steps :
12+ - name : Wait for podspec
13+ shell : bash
14+ env :
15+ VERSION : ${{ inputs.version }}
16+ run : |
17+ set -euo pipefail
18+ VERSIONS_URL="https://cdn.cocoapods.org/all_pods_versions_d_f_3.txt"
19+ SPEC_URL="https://cdn.cocoapods.org/Specs/d/f/3/OneSignalXCFramework/${VERSION}/OneSignalXCFramework.podspec.json"
20+
21+ echo "Waiting for OneSignalXCFramework:${VERSION}"
22+ echo "Versions URL: ${VERSIONS_URL}"
23+ echo "Spec URL: ${SPEC_URL}"
24+
25+ for attempt in {1..50}; do
26+ if curl -fsSL "${VERSIONS_URL}" | awk -F/ -v version="${VERSION}" '
27+ $1 == "OneSignalXCFramework" {
28+ for (i = 2; i <= NF; i++) {
29+ if ($i == version) {
30+ found = 1
31+ }
32+ }
33+ }
34+ END { exit found ? 0 : 1 }
35+ ' &&
36+ curl -fsSL "${SPEC_URL}" --output /dev/null; then
37+ echo "OneSignalXCFramework:${VERSION} is available on CocoaPods CDN"
38+ exit 0
39+ fi
40+
41+ echo "OneSignalXCFramework:${VERSION} not available yet; retrying in 60s (${attempt}/50)"
42+ sleep 60
43+ done
44+
45+ echo "Timed out waiting for OneSignalXCFramework:${VERSION} on CocoaPods CDN"
46+ exit 1
Original file line number Diff line number Diff line change @@ -153,8 +153,31 @@ jobs:
153153 with :
154154 version : ${{ inputs.android_version }}
155155
156+ wait-for-ios-pod :
157+ # CocoaPods CDN propagation can lag behind pod publish. Block wrapper PR
158+ # fan-out until both the version shard and podspec JSON are visible so
159+ # downstream iOS builds do not fail resolving OneSignalXCFramework.
160+ # Always runs so Android-only invocations still satisfy downstream needs.
161+ needs : validate-inputs
162+ runs-on : ubuntu-latest
163+ steps :
164+ - name : Skip when Android-only
165+ if : inputs.ios_version == ''
166+ run : echo "No ios_version provided; skipping CocoaPods propagation wait."
167+ - uses : actions/checkout@v6
168+ if : inputs.ios_version != ''
169+ with :
170+ repository : OneSignal/sdk-shared
171+ ref : main
172+ sparse-checkout : |
173+ .github/actions/wait-for-cocoapods-pod
174+ - uses : ./.github/actions/wait-for-cocoapods-pod
175+ if : inputs.ios_version != ''
176+ with :
177+ version : ${{ inputs.ios_version }}
178+
156179 versions :
157- needs : [validate-inputs, wait-for-android-artifact]
180+ needs : [validate-inputs, wait-for-android-artifact, wait-for-ios-pod ]
158181 runs-on : ubuntu-latest
159182 outputs :
160183 capacitor : ${{ steps.versions.outputs.capacitor }}
You can’t perform that action at this time.
0 commit comments