release.yml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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. uses: ./.github/workflows/reusable_release_buildup_repo.yml
  75. with:
  76. pod_name: FirebaseCore
  77. secrets:
  78. bot_access_token: ${{ secrets.RELEASE_TESTING_PAT }}
  79. buildup_SpecsReleasing_repo:
  80. needs: [buildup_SpecsReleasing_repo_FirebaseCore, specs_checking]
  81. strategy:
  82. fail-fast: false
  83. matrix: ${{fromJson(needs.specs_checking.outputs.matrix)}}
  84. uses: ./.github/workflows/reusable_release_buildup_repo.yml
  85. with:
  86. pod_name: ${{ matrix.podspec }}
  87. allow_warnings: ${{ matrix.allowwarnings }}
  88. secrets:
  89. bot_access_token: ${{ secrets.RELEASE_TESTING_PAT }}
  90. abtesting_quickstart:
  91. needs: buildup_SpecsReleasing_repo
  92. uses: ./.github/workflows/reusable_release_quickstart.yml
  93. with:
  94. product: abtesting
  95. runs-on: macos-14
  96. legacy: true
  97. test-swift: false # The script only supports one argument.
  98. secrets:
  99. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  100. bot_access_token: ${{ secrets.RELEASE_TESTING_PAT }}
  101. auth_quickstart:
  102. needs: buildup_SpecsReleasing_repo
  103. uses: ./.github/workflows/reusable_release_quickstart.yml
  104. with:
  105. product: Authentication
  106. runs-on: macos-15
  107. xcode-version: 16.2
  108. secrets:
  109. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  110. bot_access_token: ${{ secrets.RELEASE_TESTING_PAT }}
  111. crashlytics_quickstart:
  112. needs: buildup_SpecsReleasing_repo
  113. uses: ./.github/workflows/reusable_release_quickstart.yml
  114. with:
  115. product: Crashlytics
  116. runs-on: macos-14
  117. legacy: true
  118. extra-setup: |
  119. mkdir -p quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics
  120. cp Crashlytics/run quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/
  121. cp Crashlytics/upload-symbols quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/
  122. secrets:
  123. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  124. bot_access_token: ${{ secrets.RELEASE_TESTING_PAT }}
  125. database_quickstart:
  126. needs: buildup_SpecsReleasing_repo
  127. uses: ./.github/workflows/reusable_release_quickstart.yml
  128. with:
  129. product: database
  130. runs-on: macos-14
  131. test-objc: true
  132. test-swift: true
  133. secrets:
  134. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  135. bot_access_token: ${{ secrets.RELEASE_TESTING_PAT }}
  136. firestore_quickstart:
  137. needs: buildup_SpecsReleasing_repo
  138. uses: ./.github/workflows/reusable_release_quickstart.yml
  139. with:
  140. product: firestore
  141. runs-on: macos-14
  142. secrets:
  143. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  144. bot_access_token: ${{ secrets.RELEASE_TESTING_PAT }}
  145. inappmessaging_quickstart:
  146. needs: buildup_SpecsReleasing_repo
  147. uses: ./.github/workflows/reusable_release_quickstart.yml
  148. with:
  149. product: inappmessaging
  150. runs-on: macos-14
  151. test-objc: true
  152. test-swift: true
  153. secrets:
  154. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  155. bot_access_token: ${{ secrets.RELEASE_TESTING_PAT }}
  156. messaging_quickstart:
  157. needs: buildup_SpecsReleasing_repo
  158. uses: ./.github/workflows/reusable_release_quickstart.yml
  159. with:
  160. product: messaging
  161. runs-on: macos-14
  162. test-objc: true
  163. test-swift: true
  164. secrets:
  165. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  166. bot_access_token: ${{ secrets.RELEASE_TESTING_PAT }}
  167. remoteconfig_quickstart:
  168. needs: buildup_SpecsReleasing_repo
  169. uses: ./.github/workflows/reusable_release_quickstart.yml
  170. with:
  171. product: config
  172. runs-on: macos-14
  173. secrets:
  174. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  175. bot_access_token: ${{ secrets.RELEASE_TESTING_PAT }}
  176. storage_quickstart:
  177. needs: buildup_SpecsReleasing_repo
  178. uses: ./.github/workflows/reusable_release_quickstart.yml
  179. with:
  180. product: storage
  181. runs-on: macos-14
  182. legacy: true
  183. secrets:
  184. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  185. bot_access_token: ${{ secrets.RELEASE_TESTING_PAT }}
  186. performance_quickstart:
  187. needs: buildup_SpecsReleasing_repo
  188. uses: ./.github/workflows/reusable_release_quickstart.yml
  189. with:
  190. product: performance
  191. runs-on: macos-14
  192. legacy: true
  193. secrets:
  194. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  195. bot_access_token: ${{ secrets.RELEASE_TESTING_PAT }}