release.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. name: release
  2. on:
  3. pull_request:
  4. paths:
  5. - 'scripts/release_testing_setup.sh'
  6. - '.github/workflows/release.yml'
  7. - 'Gemfile*'
  8. workflow_dispatch:
  9. schedule:
  10. # Run every day at 9pm (PST) - cron uses UTC times
  11. - cron: '0 5 * * *'
  12. env:
  13. FIREBASE_CI: true
  14. concurrency:
  15. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  16. cancel-in-progress: true
  17. jobs:
  18. specs_checking:
  19. # Don't run on private repo unless it is a PR.
  20. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch'
  21. runs-on: macos-14
  22. env:
  23. botaccess: ${{ secrets.RELEASE_TESTING_PAT }}
  24. local_repo: specsreleasing
  25. podspec_repo_branch: main
  26. outputs:
  27. matrix: ${{ steps.generate_matrix.outputs.matrix }}
  28. steps:
  29. - name: Checkout code
  30. uses: actions/checkout@v4
  31. with:
  32. fetch-depth: 0
  33. - name: Generate matrix
  34. id: generate_matrix
  35. run: |
  36. cd "${GITHUB_WORKSPACE}/ReleaseTooling"
  37. swift run manifest --sdk-repo-url "${GITHUB_WORKSPACE}" --output-file-path ./output.json --for-gha-matrix-generation
  38. echo "::set-output name=matrix::{\"include\":$( cat output.json )}"
  39. - name: Update SpecsReleasing repo setup
  40. run: |
  41. podspec_repo_branch="${podspec_repo_branch}" \
  42. scripts/release_testing_setup.sh release_testing
  43. - name: Clean spec repo
  44. run: |
  45. git clone --quiet https://"$botaccess"@github.com/Firebase/SpecsReleasing.git "${local_repo}"
  46. cd "${local_repo}"
  47. # Remove all unhidden dirs, i.e. all podspec dir from the spec repo.
  48. rm -Rf -- */
  49. git add .
  50. # commit without diff will throw an error. `git diff --exit-code` can avoid such error.
  51. git diff --staged --exit-code || git commit -m "Empty spec repo."
  52. # Attempt to push. If it fails, print a detailed error message and exit.
  53. git push || {
  54. echo "--------------------------------------------------------------------------------"
  55. echo "ERROR: Failed to push to Firebase/SpecsReleasing."
  56. echo "This is likely due to an expired Personal Access Token (PAT)."
  57. echo "Please take the following steps to resolve this:"
  58. echo "1. Refresh the OSS bot's scoped access token for the Firebase/SpecsReleasing repo."
  59. echo " This can be done in the OSS bot's GitHub account settings. Ensure the token "
  60. echo " has the 'public_repo' scope."
  61. echo "2. Update the 'RELEASE_TESTING_PAT' secret in this repo's settings."
  62. echo " (https://github.com/Firebase/firebase-ios-sdk/settings/secrets/actions)"
  63. echo "--------------------------------------------------------------------------------"
  64. exit 1
  65. }
  66. - uses: actions/upload-artifact@v4
  67. with:
  68. name: firebase-ios-sdk
  69. path: |
  70. *.podspec
  71. *.podspec.json
  72. buildup_SpecsReleasing_repo_FirebaseCore:
  73. needs: specs_checking
  74. # Don't run on private repo unless it is a PR.
  75. if: github.repository == 'Firebase/firebase-ios-sdk'
  76. runs-on: macos-15
  77. env:
  78. botaccess: ${{ secrets.RELEASE_TESTING_PAT }}
  79. local_repo: specsreleasing
  80. local_sdk_repo_dir: /tmp/test/firebase-ios-sdk
  81. targeted_pod: FirebaseCore
  82. steps:
  83. - uses: actions/checkout@v4
  84. - uses: actions/download-artifact@v4.1.7
  85. with:
  86. name: firebase-ios-sdk
  87. path: ${{ env.local_sdk_repo_dir }}
  88. - name: Update SpecsReleasing repo
  89. run: |
  90. cd scripts/create_spec_repo/
  91. swift build
  92. pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsReleasing.git
  93. BOT_TOKEN="${botaccess}" ${GITHUB_WORKSPACE}/scripts/third_party/travis/retry.sh .build/debug/spec-repo-builder \
  94. --sdk-repo "${local_sdk_repo_dir}" \
  95. --local-spec-repo-name "${local_repo}" \
  96. --pod-sources 'https://github.com/Firebase/SpecsReleasing' "https://github.com/firebase/SpecsStaging.git" "https://github.com/CocoaPods/Specs.git" \
  97. --include-pods "${targeted_pod}" --keep-repo
  98. - name: Clean Artifacts
  99. if: ${{ always() }}
  100. run: pod repo remove "${local_repo}"
  101. buildup_SpecsReleasing_repo:
  102. needs: [buildup_SpecsReleasing_repo_FirebaseCore, specs_checking]
  103. # Don't run on private repo unless it is a PR.
  104. if: github.repository == 'Firebase/firebase-ios-sdk' || github.event_name == 'workflow_dispatch'
  105. runs-on: macos-15
  106. strategy:
  107. fail-fast: false
  108. matrix: ${{fromJson(needs.specs_checking.outputs.matrix)}}
  109. env:
  110. botaccess: ${{ secrets.RELEASE_TESTING_PAT }}
  111. local_repo: specsreleasing
  112. local_sdk_repo_dir: /tmp/test/firebase-ios-sdk
  113. targeted_pod: ${{ matrix.podspec }}
  114. steps:
  115. - uses: actions/checkout@v4
  116. - uses: actions/download-artifact@v4.1.7
  117. with:
  118. name: firebase-ios-sdk
  119. path: ${{ env.local_sdk_repo_dir }}
  120. - name: Update SpecsReleasing repo
  121. run: |
  122. [[ ${{ matrix.allowwarnings }} == true ]] && ALLOWWARNINGS=true
  123. cd scripts/create_spec_repo/
  124. swift build
  125. pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsReleasing.git
  126. # ${ALLOWWARNINGS:+--allow-warnings} will add --allow-warnings to the
  127. # command if ${ALLOWWARNINGS} is not null.
  128. BOT_TOKEN="${botaccess}" ${GITHUB_WORKSPACE}/scripts/third_party/travis/retry.sh .build/debug/spec-repo-builder \
  129. --sdk-repo "${local_sdk_repo_dir}" \
  130. --local-spec-repo-name "${local_repo}" \
  131. --pod-sources 'https://github.com/Firebase/SpecsReleasing' "https://github.com/firebase/SpecsStaging.git" "https://github.com/CocoaPods/Specs.git" \
  132. --include-pods "${targeted_pod}" \
  133. --keep-repo ${ALLOWWARNINGS:+--allow-warnings}
  134. - name: Clean Artifacts
  135. if: ${{ always() }}
  136. run: pod repo remove "${local_repo}"
  137. quickstart_tests:
  138. # Don't run on private repo unless it is a PR.
  139. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
  140. needs: buildup_SpecsReleasing_repo
  141. strategy:
  142. fail-fast: false
  143. matrix:
  144. include:
  145. - quickstart-name: "abtesting"
  146. legacy: true
  147. runs-on: "macos-14"
  148. test-command: "([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh ABTesting true)"
  149. remove-data-command: "scripts/remove_data.sh config"
  150. - quickstart-name: "auth"
  151. runs-on: "macos-15"
  152. test-command: "([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Authentication false)"
  153. xcode-version: "16.2"
  154. setup-command: "BOT_TOKEN=\"${botaccess}\" scripts/setup_quickstart.sh Authentication nightly_release_testing"
  155. remove-data-command: "scripts/remove_data.sh authentication"
  156. - quickstart-name: "crashlytics"
  157. legacy: true
  158. runs-on: "macos-14"
  159. test-command: "([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Crashlytics true swift)"
  160. extra-setup-command: |
  161. mkdir -p quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics
  162. cp Crashlytics/run quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/
  163. cp Crashlytics/upload-symbols quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/
  164. setup-command: "BOT_TOKEN=\"${botaccess}\" scripts/setup_quickstart.sh Crashlytics nightly_release_testing"
  165. remove-data-command: "scripts/remove_data.sh crashlytics"
  166. - quickstart-name: "database"
  167. runs-on: "macos-14"
  168. test-command: |
  169. ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false)
  170. ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false swift)
  171. remove-data-command: "scripts/remove_data.sh database"
  172. - quickstart-name: "firestore"
  173. runs-on: "macos-14"
  174. test-command: "([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Firestore false)"
  175. remove-data-command: "scripts/remove_data.sh firestore"
  176. - quickstart-name: "inappmessaging"
  177. runs-on: "macos-14"
  178. test-command: |
  179. ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh InAppMessaging true)
  180. ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh InAppMessaging true swift)
  181. remove-data-command: "scripts/remove_data.sh inappmessaging"
  182. - quickstart-name: "messaging"
  183. runs-on: "macos-14"
  184. test-command: |
  185. ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Messaging false)
  186. ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Messaging false swift)
  187. remove-data-command: "scripts/remove_data.sh messaging"
  188. - quickstart-name: "remoteconfig"
  189. runs-on: "macos-14"
  190. test-command: "([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Config true)"
  191. setup-command: "BOT_TOKEN=\"${botaccess}\" scripts/setup_quickstart.sh config nightly_release_testing"
  192. remove-data-command: "scripts/remove_data.sh config"
  193. - quickstart-name: "storage"
  194. legacy: true
  195. runs-on: "macos-14"
  196. test-command: "([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Storage true swift)"
  197. remove-data-command: "scripts/remove_data.sh storage"
  198. - quickstart-name: "performance"
  199. runs-on: "macos-14"
  200. test-command: "([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true swift)"
  201. setup-command: "BOT_TOKEN=\"${botaccess}\" scripts/setup_quickstart.sh Performance nightly_release_testing"
  202. remove-data-command: "scripts/remove_data.sh performance"
  203. uses: ./.github/workflows/reusable-quickstart.yml@main
  204. with:
  205. quickstart-name: ${{ matrix.quickstart-name }}
  206. legacy: ${{ matrix.legacy }}
  207. runs-on: ${{ matrix.runs-on }}
  208. test-command: ${{ matrix.test-command }}
  209. extra-setup-command: ${{ matrix.extra-setup-command }}
  210. xcode-version: ${{ matrix.xcode-version }}
  211. secrets:
  212. GHASecretsGPGPassphrase1: ${{ secrets.GHASecretsGPGPassphrase1 }}
  213. RELEASE_TESTING_PAT: ${{ secrets.RELEASE_TESTING_PAT }}