release.zip #71
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow tests the zip distribution of the SDK. | |
| # There are three ways to configure the source of the zip file for testing: | |
| # 1. To iterate on a PR: Set the `PINNED_RUN_ID` environment variable in this | |
| # file to a successful zip packaging run. This is useful for avoiding | |
| # having to manually re-run the packaging jobs for each commit. | |
| # 2. For manual runs: Trigger the workflow via the [GitHub UI](https://github.com/firebase/firebase-ios-sdk/actions/workflows/release.zip.yml) | |
| # and provide a "Run ID of a previous successful zip workflow" in the input. | |
| # 3. By default (for scheduled and other PR runs): The workflow will build the | |
| # zip from the current commit (HEAD). | |
| name: release.zip | |
| # TODO(ncooke3): Also do Xcode 26 testing | |
| permissions: | |
| actions: read | |
| contents: read | |
| env: | |
| # When specified, build jobs will be skipped and the specified | |
| # run's artifacts will be used for testing. | |
| PINNED_RUN_ID: '' | |
| # Firebase's minimum supported Xcode. This is what the binary artifacts are | |
| # built with. Changing this version must only be done in alignment with | |
| # updates to the minimum supported Xcode supported for App Store submissions. | |
| MIN_XCODE: Xcode_16.2 # WARNING: Read above comment. | |
| on: | |
| pull_request: | |
| paths: | |
| - 'ReleaseTooling/Sources/**' | |
| - '.github/workflows/release.zip.yml' | |
| - '.github/workflows/_quickstart.framework.yml' | |
| - 'scripts/zip/**' | |
| - 'Gemfile*' | |
| # Don't run based on any markdown only changes. | |
| - '!ReleaseTooling/*.md' | |
| schedule: | |
| # Run every day at 9pm (PDT) / 12am (EDT) - cron uses UTC times | |
| - cron: '0 4 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| custom_spec_repos: | |
| description: 'Custom Podspec repos' | |
| required: true | |
| default: 'https://github.com/firebase/SpecsStaging.git' | |
| zip_run_id: | |
| # For example, in the below URL, `17335533279` is the run ID: | |
| # - https://github.com/firebase/firebase-ios-sdk/actions/runs/17335533279 | |
| description: 'Run ID of a previous successful zip workflow to use for quickstart testing' | |
| required: false | |
| default: '' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| should_package: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_package: ${{ steps.check.outputs.should_package }} | |
| steps: | |
| - name: Fail workflow if PINNED_RUN_ID is set on a schedule | |
| if: github.event_name == 'schedule' && env.PINNED_RUN_ID != '' | |
| run: | | |
| echo "ERROR: PINNED_RUN_ID is set for a scheduled run. Unset it to allow the workflow to proceed." | |
| exit 1 | |
| - name: Check if packaging should be skipped | |
| id: check | |
| env: | |
| ZIP_RUN_ID: ${{ github.event.inputs.zip_run_id }} | |
| run: | | |
| if [[ -n "${{ env.PINNED_RUN_ID }}" || -n "$ZIP_RUN_ID" ]]; then | |
| echo "should_package=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "should_package=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| package-release: | |
| needs: should_package | |
| # Don't run on private repo. | |
| if: | | |
| github.repository == 'firebase/firebase-ios-sdk' && | |
| contains(fromJSON('["schedule", "pull_request", "workflow_dispatch"]'), github.event_name) && | |
| needs.should_package.outputs.should_package == 'true' | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Xcode | |
| run: sudo xcode-select -s /Applications/${{ env.MIN_XCODE }}.app/Contents/Developer | |
| - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1 | |
| - name: Setup Bundler | |
| run: ./scripts/setup_bundler.sh | |
| - name: ZipBuildingTest | |
| env: | |
| SPEC_REPOS: ${{ github.event.inputs.custom_spec_repos || 'https://github.com/firebase/SpecsStaging.git' }} | |
| run: | | |
| mkdir -p release_zip_dir | |
| sh -x scripts/zip/build_zip.sh release_zip_dir \ | |
| "$SPEC_REPOS" \ | |
| build-release \ | |
| static | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: Firebase-release-zip-zip | |
| # Zip the entire output directory since the builder adds subdirectories we don't know the | |
| # name of. | |
| path: release_zip_dir | |
| build: | |
| needs: should_package | |
| # Don't run on private repo unless it is a PR. | |
| if: | | |
| github.repository == 'firebase/firebase-ios-sdk' && | |
| contains(fromJSON('["schedule", "pull_request", "workflow_dispatch"]'), github.event_name) && | |
| needs.should_package.outputs.should_package == 'true' | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Xcode | |
| run: sudo xcode-select -s /Applications/${{ env.MIN_XCODE }}.app/Contents/Developer | |
| - name: Build | |
| run: | | |
| cd ReleaseTooling | |
| swift build -v | |
| package-head: | |
| needs: [build, should_package] | |
| if: needs.should_package.outputs.should_package == 'true' | |
| strategy: | |
| matrix: | |
| linking_type: [static, dynamic] | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Xcode | |
| run: sudo xcode-select -s /Applications/${{ env.MIN_XCODE }}.app/Contents/Developer | |
| - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1 | |
| - name: Setup Bundler | |
| run: ./scripts/setup_bundler.sh | |
| - name: ZipBuildingTest | |
| env: | |
| SPEC_REPOS: ${{ github.event.inputs.custom_spec_repos || 'https://github.com/firebase/SpecsStaging.git,https://github.com/firebase/SpecsDev.git' }} | |
| run: | | |
| mkdir -p zip_output_dir | |
| sh -x scripts/zip/build_zip.sh \ | |
| zip_output_dir "$SPEC_REPOS" \ | |
| build-head \ | |
| "${{ matrix.linking_type }}" | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| if: always() | |
| with: | |
| name: ${{ matrix.linking_type == 'static' && 'Firebase-actions-dir' || 'Firebase-actions-dir-dynamic' }} | |
| # Zip the entire output directory since the builder adds subdirectories we don't know the | |
| # name of. | |
| path: zip_output_dir | |
| packaging_done: | |
| runs-on: ubuntu-latest | |
| needs: [package-head] | |
| if: always() | |
| outputs: | |
| run_id: ${{ steps.get_run_id.outputs.run_id }} | |
| steps: | |
| - name: Check packaging result | |
| if: ${{ needs.package-head.result == 'failure' }} | |
| run: | | |
| echo "Packaging failed. Aborting." | |
| exit 1 | |
| - name: Get Run ID | |
| id: get_run_id | |
| env: | |
| ZIP_RUN_ID: ${{ github.event.inputs.zip_run_id }} | |
| run: | | |
| if [[ -n "$ZIP_RUN_ID" ]]; then | |
| echo "run_id=$ZIP_RUN_ID" >> "$GITHUB_OUTPUT" | |
| elif [[ -n "${{ env.PINNED_RUN_ID }}" ]]; then | |
| echo "run_id=${{ env.PINNED_RUN_ID }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "run_id=${{ github.run_id }}" >> "$GITHUB_OUTPUT" | |
| fi | |
| check_framework_firestore_symbols: | |
| needs: packaging_done | |
| if: ${{ !cancelled() }} | |
| env: | |
| FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 | |
| runs-on: macos-14 | |
| steps: | |
| - name: Xcode | |
| run: sudo xcode-select -s /Applications/${{ env.MIN_XCODE }}.app/Contents/Developer | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Get framework dir | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| name: Firebase-actions-dir | |
| run-id: ${{ needs.packaging_done.outputs.run_id }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1 | |
| - name: Setup Bundler | |
| run: ./scripts/setup_bundler.sh | |
| - name: Install xcpretty | |
| run: gem install xcpretty | |
| - name: Move frameworks | |
| run: | | |
| mkdir -p "${HOME}"/ios_frameworks/ | |
| find "${GITHUB_WORKSPACE}" -name "Firebase*latest.zip" -exec unzip -d "${HOME}"/ios_frameworks/ {} + | |
| - name: Check linked Firestore.xcframework for unlinked symbols. | |
| run: | | |
| scripts/check_firestore_symbols.sh \ | |
| "$(pwd)" \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseFirestore/FirebaseFirestoreInternal.xcframework | |
| quickstart_framework_matrix: | |
| needs: packaging_done | |
| if: github.event.pull_request.head.repo.fork == false && !cancelled() | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| artifact: [Firebase-actions-dir, Firebase-actions-dir-dynamic] | |
| config: | |
| - product: "ABTesting" | |
| plist_src: "scripts/gha-encrypted/qs-abtesting.plist.gpg" | |
| plist_dst: "quickstart-ios/abtesting/GoogleService-Info.plist" | |
| command: | | |
| SAMPLE="ABTesting" TARGET="ABTestingExample" scripts/zip/setup_quickstart_framework.sh \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseRemoteConfig/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseCore.xcframework \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseCoreInternal.xcframework \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FBLPromises.xcframework \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseInstallations.xcframework \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/GoogleUtilities.xcframework | |
| - product: "Authentication" | |
| plist_src: "scripts/gha-encrypted/qs-authentication.plist.gpg" | |
| plist_dst: "quickstart-ios/authentication/GoogleService-Info.plist" | |
| command: | | |
| SAMPLE="Authentication" TARGET="AuthenticationExample" \ | |
| NON_FIREBASE_SDKS="FBSDKLoginKit FBSDKCoreKit FBSDKCoreKit_Basics FBAEMKit" \ | |
| scripts/zip/setup_quickstart_framework.sh \ | |
| "${HOME}"/ios_frameworks/Firebase/NonFirebaseSDKs/* \ | |
| "${HOME}"/ios_frameworks/Firebase/GoogleSignIn/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAuth/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/* | |
| - product: "Config" | |
| plist_src: "scripts/gha-encrypted/qs-config.plist.gpg" | |
| plist_dst: "quickstart-ios/config/GoogleService-Info.plist" | |
| command: | | |
| SAMPLE="Config" TARGET="ConfigExample" scripts/zip/setup_quickstart_framework.sh \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseRemoteConfig/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/* | |
| - product: "Crashlytics" | |
| plist_src: "scripts/gha-encrypted/qs-crashlytics.plist.gpg" | |
| plist_dst: "quickstart-ios/crashlytics/GoogleService-Info.plist" | |
| command: | | |
| rm -rf "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseAnalytics* | |
| rm -rf "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/GoogleAppMeasurement* | |
| rm -rf "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/GoogleAds* | |
| SAMPLE="Crashlytics" TARGET="CrashlyticsExample" scripts/zip/setup_quickstart_framework.sh \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseCrashlytics/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/* | |
| cd quickstart-ios/crashlytics | |
| "${GITHUB_WORKSPACE}"/quickstart-ios/scripts/add_framework_script.rb --sdk "Crashlytics" \ | |
| --target "CrashlyticsExample_(watchOS)_Extension" \ | |
| --framework_path Firebase/ | |
| cd ../../ | |
| scripts/patch_crashlytics_run_path.rb | |
| - product: "Database" | |
| plist_src: "scripts/gha-encrypted/qs-database.plist.gpg" | |
| plist_dst: "quickstart-ios/database/GoogleService-Info.plist" | |
| os: "macos-14" # Override default | |
| xcode: "Xcode_16.2" # Override default | |
| command: | | |
| SAMPLE="Database" TARGET="DatabaseExample" NON_FIREBASE_SDKS="FirebaseDatabaseUI" \ | |
| scripts/zip/setup_quickstart_framework.sh \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseDatabase/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseStorage/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseFirestore/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAuth/* \ | |
| "${HOME}"/ios_frameworks/Firebase/NonFirebaseSDKs/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/* | |
| - product: "FirebaseAI" | |
| plist_src: "scripts/gha-encrypted/FirebaseAI/TestApp-GoogleService-Info.plist.gpg" | |
| plist_dst: "quickstart-ios/firebaseai/GoogleService-Info.plist" | |
| scheme: "FirebaseAIExample (iOS)" # Special property | |
| command: | | |
| SAMPLE="$SDK" TARGET="${SDK}Example" scripts/zip/setup_quickstart_framework.sh \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAILogic/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/* | |
| - product: "Firestore" | |
| plist_src: "scripts/gha-encrypted/qs-firestore.plist.gpg" | |
| plist_dst: "quickstart-ios/firestore/GoogleService-Info.plist" | |
| command: | | |
| SAMPLE="Firestore" TARGET="FirestoreExample" \ | |
| NON_FIREBASE_SDKS="SDWebImage FirebaseAuthUI FirebaseEmailAuthUI" \ | |
| scripts/zip/setup_quickstart_framework.sh \ | |
| "${HOME}"/ios_frameworks/Firebase/NonFirebaseSDKs/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseFirestore/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAuth/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/* | |
| - product: "InAppMessaging" | |
| plist_src: "scripts/gha-encrypted/qs-inappmessaging.plist.gpg" | |
| plist_dst: "quickstart-ios/inappmessaging/GoogleService-Info.plist" | |
| command: | | |
| SAMPLE="InAppMessaging" TARGET="InAppMessagingExample" scripts/zip/setup_quickstart_framework.sh \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseInAppMessaging/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/* | |
| - product: "Messaging" | |
| plist_src: "scripts/gha-encrypted/qs-messaging.plist.gpg" | |
| plist_dst: "quickstart-ios/messaging/GoogleService-Info.plist" | |
| command: | | |
| SAMPLE="Messaging" TARGET="MessagingExample" scripts/zip/setup_quickstart_framework.sh \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseMessaging/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/* | |
| cd quickstart-ios/messaging | |
| "${GITHUB_WORKSPACE}"/quickstart-ios/scripts/add_framework_script.rb \ | |
| --sdk "Messaging" \ | |
| --target "NotificationServiceExtension" \ | |
| --framework_path Firebase/ | |
| - product: "Storage" | |
| plist_src: "scripts/gha-encrypted/qs-storage.plist.gpg" | |
| plist_dst: "quickstart-ios/storage/GoogleService-Info.plist" | |
| command: | | |
| SAMPLE="Storage" TARGET="StorageExample" scripts/zip/setup_quickstart_framework.sh \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseStorage/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAuth/* \ | |
| "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/* | |
| uses: ./.github/workflows/_quickstart.framework.yml | |
| name: ${{ matrix.config.product }} / ${{ matrix.artifact == 'Firebase-actions-dir' && 'static' || 'dynamic' }} | |
| with: | |
| product: ${{ matrix.config.product }} | |
| zip_run_id: ${{ needs.packaging_done.outputs.run_id }} | |
| artifact_name: ${{ matrix.artifact }} | |
| # Use defaults for most, override for Database | |
| os: ${{ matrix.config.os || 'macos-15' }} | |
| xcode: ${{ matrix.config.xcode || 'Xcode_16.4' }} | |
| # Optional scheme (only used by FirebaseAI) | |
| scheme: ${{ matrix.config.scheme }} | |
| plist_src_path: ${{ matrix.config.plist_src }} | |
| plist_dst_path: ${{ matrix.config.plist_dst }} | |
| setup_command: ${{ matrix.config.command }} | |
| secrets: | |
| plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} |