|
25 | 25 | jobs:
|
26 | 26 | update_dependencies:
|
27 | 27 | name: update-deps
|
28 |
| - runs-on: ubuntu-latest |
| 28 | + runs-on: macos-latest |
29 | 29 | steps:
|
30 | 30 | - name: Get token for firebase-workflow-trigger
|
31 | 31 | uses: tibdex/github-app-token@v1
|
|
77 | 77 | fi
|
78 | 78 | # iOS: Update Firestore external version to match Firestore Cocoapod version.
|
79 | 79 | firestore_version=$(grep "pod 'Firebase/Firestore'" ios_pod/Podfile | sed "s/.*'\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)'.*/\1/")
|
| 80 | + echo "Setting Firestore external version to ${firestore_version}" |
80 | 81 | sed -i~ "s/^set(version [^)]*)/set(version CocoaPods-${firestore_version})/i" cmake/external/firestore.cmake
|
| 82 | + # iOS: Update Analytics header files, used for generating constants. |
| 83 | + analytics_version=$(grep "pod 'Firebase/Analytics'" ios_pod/Podfile | sed "s/.*'\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)'.*/\1/") |
| 84 | + if [[ "$(uname)" == "Darwin"* ]]; then |
| 85 | + echo "Updating Analytics iOS headers from version ${analytics_version}" |
| 86 | + # Unfortunately we can't just download these headers from GitHub, as |
| 87 | + # Analytics is closed-source. If it becomes open-source, we could just |
| 88 | + # download the header files from the iOS SDK's release branch. So instead, |
| 89 | + # download the Firebase Analytics cocoapod (via a stub project) and get the |
| 90 | + # header from there. This will only work on macOS. |
| 91 | + podtmp="$(mktemp -d)" |
| 92 | + cd "${podtmp}" |
| 93 | + # Generate a Podfile for Firebase/Analytics. Use the Specs.git |
| 94 | + # source to avoid any propagation delays due to CocoaPods mirror. |
| 95 | + echo "source 'https://github.com/CocoaPods/Specs.git'" > Podfile |
| 96 | + echo "platform :ios, '14.0'" >> Podfile |
| 97 | + echo "pod 'Firebase/Analytics', '${analytics_version}'" >> Podfile |
| 98 | + pod repo update |
| 99 | + pod install || true # ignore error since there is no Xcode project |
| 100 | + declare -a header_dirs |
| 101 | + # Get all of the framework header directories from the xcframework. |
| 102 | + header_dirs=(Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.xcframework/*/FirebaseAnalytics.framework/Headers) |
| 103 | + # Just use the first directory found, the headers should be the same across |
| 104 | + # all of the frameworks. |
| 105 | + header_dir="${header_dirs[0]}" |
| 106 | + cd - |
| 107 | + cd analytics/ios_headers |
| 108 | + for ios_header in *.h; do |
| 109 | + # Each file in this directory matches a file in the Analytics iOS SDK. |
| 110 | + cp -vf "${podtmp}/${header_dir}/${ios_header}" . |
| 111 | + # Add a note to each file about its source. |
| 112 | + sed -i~ 's|^/// @file|// Copied from Firebase Analytics iOS SDK '"${analytics_version}"'.\n\n/// @file|' "${ios_header}" |
| 113 | + rm -f "${ios_header}~" # remove backup file that sed generated |
| 114 | + python ../../scripts/format_code.py --f "${ios_header}" |
| 115 | + done |
| 116 | + cd - |
| 117 | + rm -rf "${podtmp}" |
| 118 | + fi |
81 | 119 | elif [[ ${{ github.event.inputs.updateAndroid }} -eq 1 ]]; then
|
82 | 120 | # Update Android only
|
83 | 121 | echo "Updating Android dependencies only"
|
|
0 commit comments