diff --git a/.github/workflows/abtesting.yml b/.github/workflows/abtesting.yml index c2bd61dc3ea..448fadbe5fe 100644 --- a/.github/workflows/abtesting.yml +++ b/.github/workflows/abtesting.yml @@ -45,8 +45,7 @@ jobs: uses: ./.github/workflows/common_quickstart.yml with: product: ABTesting - is_legacy: true - setup_command: QUICKSTART_BRANCH=nc/quickstarts scripts/setup_quickstart_spm.sh abtesting + setup_command: scripts/setup_quickstart_spm.sh abtesting plist_src_path: scripts/gha-encrypted/qs-abtesting.plist.gpg plist_dst_path: quickstart-ios/abtesting/GoogleService-Info.plist secrets: @@ -67,7 +66,6 @@ jobs: # python-version: '3.11' # - name: Setup quickstart # env: - # LEGACY: true # run: scripts/setup_quickstart.sh abtesting # - name: Install Secret GoogleService-Info.plist # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \ @@ -76,7 +74,6 @@ jobs: # run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer # - name: Build swift quickstart # env: - # LEGACY: true # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh ABTesting) # - id: ftl_test # uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4 diff --git a/.github/workflows/auth.yml b/.github/workflows/auth.yml index d7880557bf0..700767b6ef2 100644 --- a/.github/workflows/auth.yml +++ b/.github/workflows/auth.yml @@ -97,8 +97,7 @@ jobs: uses: ./.github/workflows/common_quickstart.yml with: product: Authentication - is_legacy: false - setup_command: QUICKSTART_BRANCH=nc/quickstarts scripts/setup_quickstart_spm.sh authentication + setup_command: scripts/setup_quickstart_spm.sh authentication plist_src_path: scripts/gha-encrypted/qs-authentication.plist.gpg plist_dst_path: quickstart-ios/authentication/GoogleService-Info.plist run_tests: false diff --git a/.github/workflows/common_quickstart.yml b/.github/workflows/common_quickstart.yml index 7f2942f6649..6cd964d4f6c 100644 --- a/.github/workflows/common_quickstart.yml +++ b/.github/workflows/common_quickstart.yml @@ -29,10 +29,12 @@ on: type: string required: true - # Whether to test the legacy version of the quickstart. - is_legacy: - type: boolean - required: true + # The branch to checkout in the quickstart repo. + quickstart_branch: + type: string + required: false + # default: 'main' # TODO: Revert to main before merging. + default: 'nc/quickstarts' # The path to the encrypted `GoogleService-Info.plist` file. plist_src_path: @@ -60,11 +62,12 @@ on: jobs: quickstart: + name: quickstart (${{ inputs.product }}) # Run on the main repo's scheduled jobs or pull requests and manual workflow invocations. if: (github.repository == 'firebase/firebase-ios-sdk' && github.event_name == 'schedule') || contains(fromJSON('["pull_request", "workflow_dispatch"]'), github.event_name) env: plist_secret: ${{ secrets.plist_secret }} - LEGACY: ${{ inputs.is_legacy && true || '' }} + QUICKSTART_BRANCH: ${{ inputs.quickstart_branch }} runs-on: macos-15 steps: - uses: actions/checkout@v4 @@ -81,7 +84,7 @@ jobs: ${{ inputs.plist_src_path }} \ ${{ inputs.plist_dst_path }} \ "$plist_secret" - - name: Build ${{ inputs.product }} Quickstart (${{ inputs.is_legacy && 'Legacy' || 'Non-Legacy' }}) + - name: Build ${{ inputs.product }} Quickstart uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 with: timeout_minutes: 15 @@ -90,7 +93,7 @@ jobs: command: | SPM=true DIR=${{ inputs.product }} scripts/test_quickstart.sh \ ${{ inputs.product }} \ - ${{ inputs.run_tests }} \ + ${{ inputs.run_tests }} # Failure sequence to upload artifact. - id: lowercase_product if: ${{ failure() }} diff --git a/.github/workflows/crashlytics.yml b/.github/workflows/crashlytics.yml index 9255eec50da..105ef5bdd7f 100644 --- a/.github/workflows/crashlytics.yml +++ b/.github/workflows/crashlytics.yml @@ -47,13 +47,7 @@ jobs: uses: ./.github/workflows/common_quickstart.yml with: product: Crashlytics - is_legacy: true - setup_command: | - scripts/setup_quickstart.sh crashlytics - mkdir quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics - # Set the deployed pod location of run and upload-symbols with the development pod version. - cp Crashlytics/run quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/ - cp Crashlytics/upload-symbols quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/ + setup_command: scripts/setup_quickstart_spm.sh crashlytics plist_src_path: scripts/gha-encrypted/qs-crashlytics.plist.gpg plist_dst_path: quickstart-ios/crashlytics/GoogleService-Info.plist secrets: @@ -76,20 +70,12 @@ jobs: # run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer # - name: Setup quickstart # run: scripts/setup_quickstart.sh crashlytics - # env: - # LEGACY: true # - name: Install Secret GoogleService-Info.plist # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-crashlytics.plist.gpg \ # quickstart-ios/crashlytics/GoogleService-Info.plist "$plist_secret" # - name: Build swift quickstart # run: | - # mkdir quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics - # # Set the deployed pod location of run and upload-symbols with the development pod version. - # cp Crashlytics/run quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/ - # cp Crashlytics/upload-symbols quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/ # ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Crashlytics swift) - # env: - # LEGACY: true # - id: ftl_test # uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4 # with: diff --git a/.github/workflows/database.yml b/.github/workflows/database.yml index 451b230d167..e6db2321c99 100644 --- a/.github/workflows/database.yml +++ b/.github/workflows/database.yml @@ -74,8 +74,7 @@ jobs: uses: ./.github/workflows/common_quickstart.yml with: product: Database - is_legacy: false - setup_command: QUICKSTART_BRANCH=nc/quickstarts scripts/setup_quickstart_spm.sh database + setup_command: scripts/setup_quickstart_spm.sh database plist_src_path: scripts/gha-encrypted/qs-database.plist.gpg plist_dst_path: quickstart-ios/database/GoogleService-Info.plist run_tests: false diff --git a/.github/workflows/firestore.yml b/.github/workflows/firestore.yml index 92d1a53c9dc..4c3e9726425 100644 --- a/.github/workflows/firestore.yml +++ b/.github/workflows/firestore.yml @@ -605,8 +605,7 @@ jobs: # uses: ./.github/workflows/common_quickstart.yml # with: # product: Firestore - # is_legacy: true - # setup_command: QUICKSTART_BRANCH=nc/quickstarts scripts/setup_quickstart_spm.sh firestore + # setup_command: scripts/setup_quickstart_spm.sh firestore # plist_src_path: scripts/gha-encrypted/qs-firestore.plist.gpg # plist_dst_path: quickstart-ios/firestore/GoogleService-Info.plist # run_tests: false diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml index 42d7b0c1395..07cafd50e4e 100644 --- a/.github/workflows/functions.yml +++ b/.github/workflows/functions.yml @@ -51,23 +51,7 @@ jobs: with: target: FirebaseFunctionsUnit - # TODO: The legacy quickstart uses material which doesn't build on Xcode 15. - # quickstart: - # uses: ./.github/workflows/common_quickstart.yml - # strategy: - # matrix: - # quickstart_type: [objc, swift] - # with: - # product: Functions - # is_legacy: true - # setup_command: | - # scripts/setup_quickstart.sh functions - # sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist - # plist_src_path: scripts/gha-encrypted/qs-functions.plist.gpg - # plist_dst_path: quickstart-ios/functions/GoogleService-Info.plist - # quickstart_type: ${{ matrix.quickstart_type }} - # secrets: - # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} + # TODO(ncooke3): Add a Functions quickstart test. # quickstart-ftl-cron-only: # # Don't run on private repo diff --git a/.github/workflows/inappmessaging.yml b/.github/workflows/inappmessaging.yml index f0bbd9597d4..9275f825492 100644 --- a/.github/workflows/inappmessaging.yml +++ b/.github/workflows/inappmessaging.yml @@ -76,8 +76,7 @@ jobs: uses: ./.github/workflows/common_quickstart.yml with: product: InAppMessaging - is_legacy: false - setup_command: QUICKSTART_BRANCH=nc/quickstarts scripts/setup_quickstart_spm.sh inappmessaging + setup_command: scripts/setup_quickstart_spm.sh inappmessaging plist_src_path: scripts/gha-encrypted/qs-inappmessaging.plist.gpg plist_dst_path: quickstart-ios/inappmessaging/GoogleService-Info.plist secrets: diff --git a/.github/workflows/installations.yml b/.github/workflows/installations.yml index 4d407c9507c..b8bbb69d6d3 100644 --- a/.github/workflows/installations.yml +++ b/.github/workflows/installations.yml @@ -53,8 +53,7 @@ jobs: uses: ./.github/workflows/common_quickstart.yml with: product: Installations - is_legacy: false - setup_command: QUICKSTART_BRANCH=nc/quickstarts scripts/setup_quickstart_spm.sh installations + setup_command: scripts/setup_quickstart_spm.sh installations plist_src_path: scripts/gha-encrypted/Installations/GoogleService-Info.plist.gpg plist_dst_path: quickstart-ios/installations/GoogleService-Info.plist secrets: diff --git a/.github/workflows/messaging.yml b/.github/workflows/messaging.yml index 6b9aa970cc4..4663b6355b8 100644 --- a/.github/workflows/messaging.yml +++ b/.github/workflows/messaging.yml @@ -85,8 +85,7 @@ jobs: uses: ./.github/workflows/common_quickstart.yml with: product: Messaging - is_legacy: false - setup_command: QUICKSTART_BRANCH=nc/quickstarts scripts/setup_quickstart_spm.sh messaging + setup_command: scripts/setup_quickstart_spm.sh messaging plist_src_path: scripts/gha-encrypted/qs-messaging.plist.gpg plist_dst_path: quickstart-ios/messaging/GoogleService-Info.plist run_tests: false diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index e14a3c44235..28447841b87 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -83,8 +83,7 @@ jobs: uses: ./.github/workflows/common_quickstart.yml with: product: Performance - is_legacy: false - setup_command: QUICKSTART_BRANCH=nc/quickstarts scripts/setup_quickstart_spm.sh performance + setup_command: scripts/setup_quickstart_spm.sh performance plist_src_path: scripts/gha-encrypted/qs-performance.plist.gpg plist_dst_path: quickstart-ios/performance/GoogleService-Info.plist secrets: diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 1de043c598f..b26e22cde33 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -1,12 +1,12 @@ name: prerelease permissions: - contents: write + contents: read on: pull_request: # closed will be triggered when a pull request is merged. This is to keep https://github.com/firebase/SpecsTesting up to date. - types: [closed] + # types: [closed] # TODO(ncooke3): Uncomment. paths: - '.github/workflows/prerelease.yml' workflow_dispatch: @@ -22,199 +22,6 @@ concurrency: cancel-in-progress: true jobs: - specs_checking: - # Don't run on private repo unless it is a PR. - if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch' - runs-on: macos-15 - env: - botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }} - local_repo: specstesting - podspec_repo_branch: main - outputs: - matrix: ${{ steps.generate_matrix.outputs.matrix }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer - - name: Generate matrix - id: generate_matrix - run: | - cd "${GITHUB_WORKSPACE}/ReleaseTooling" - swift run manifest --sdk-repo-url "${GITHUB_WORKSPACE}" --output-file-path ./output.json --for-gha-matrix-generation - echo "::set-output name=matrix::{\"include\":$( cat output.json )}" - - name: Update SpecsTesting repo setup - run: | - podspec_repo_branch="${podspec_repo_branch}" \ - scripts/release_testing_setup.sh prerelease_testing - env: - BOT_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Clean spec repo - run: | - git clone --quiet https://${botaccess}@github.com/Firebase/SpecsTesting.git "${local_repo}" - cd "${local_repo}" - # Remove all unhidden dirs, i.e. all podspec dir from the spec repo. - rm -Rf -- */ - git add . - # commit without diff will throw an error. `git diff --exit-code` can avoid such error. - git diff --staged --exit-code || git commit -m "Empty spec repo." - # Attempt to push. If it fails, print a detailed error message and exit. - git push || { - echo "--------------------------------------------------------------------------------" - echo "ERROR: Failed to push to Firebase/SpecsTesting." - echo "This is likely due to an expired Personal Access Token (PAT)." - echo "Please take the following steps to resolve this:" - echo "1. Refresh the OSS bot's scoped access token for the Firebase/SpecsTesting repo." - echo " This can be done in the OSS bot's GitHub account settings. Ensure the token " - echo " has the 'public_repo' scope." - echo "2. Update the 'PRERELEASE_TESTING_PAT' secret in this repo's settings." - echo " (https://github.com/Firebase/firebase-ios-sdk/settings/secrets/actions)" - echo "--------------------------------------------------------------------------------" - exit 1 - } - - name: Clean Artifacts - if: ${{ always() }} - run: | - rm -rf prerelease-testing-token.txt - - uses: actions/upload-artifact@v4 - with: - name: firebase-ios-sdk - path: | - *.podspec - *.podspec.json - - buildup_SpecsTesting_repo_FirebaseCore: - needs: specs_checking - # Don't run on private repo unless it is a PR. - if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch' - runs-on: macos-15 - env: - botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }} - local_repo: specstesting - local_sdk_repo_dir: /tmp/test/firebase-ios-sdk - targeted_pod: FirebaseCore - steps: - - uses: actions/checkout@v4 - - name: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer - - uses: actions/download-artifact@v4.1.7 - with: - name: firebase-ios-sdk - path: ${{ env.local_sdk_repo_dir }} - # Addresses flaky pushes due to missing git config on runner. - - name: Set git config - run: | - git config --global user.email "google-oss-bot@example.com" - git config --global user.name "google-oss-bot" - - name: Update SpecsTesting repo - run: | - cd scripts/create_spec_repo/ - swift build - pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsTesting.git - BOT_TOKEN="${botaccess}" ${GITHUB_WORKSPACE}/scripts/third_party/travis/retry.sh .build/debug/spec-repo-builder \ - --sdk-repo "${local_sdk_repo_dir}" \ - --local-spec-repo-name "${local_repo}" \ - --sdk-repo-name SpecsTesting \ - --github-account Firebase \ - --pod-sources 'https://${BOT_TOKEN}@github.com/Firebase/SpecsTesting' "https://github.com/firebase/SpecsDev.git" "https://github.com/firebase/SpecsStaging.git" "https://github.com/CocoaPods/Specs.git" \ - --include-pods "${targeted_pod}" --keep-repo - - name: Clean Artifacts - if: ${{ always() }} - run: pod repo remove "${local_repo}" - - buildup_SpecsTesting_repo: - needs: [buildup_SpecsTesting_repo_FirebaseCore, specs_checking] - # Don't run on private repo unless it is a PR. - if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch' - runs-on: macos-15 - strategy: - fail-fast: false - matrix: ${{fromJson(needs.specs_checking.outputs.matrix)}} - env: - botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }} - local_repo: specstesting - local_sdk_repo_dir: /tmp/test/firebase-ios-sdk - targeted_pod: ${{ matrix.podspec }} - steps: - - uses: actions/checkout@v4 - - name: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer - - uses: actions/download-artifact@v4.1.7 - with: - name: firebase-ios-sdk - path: ${{ env.local_sdk_repo_dir }} - # Addresses flaky pushes due to missing git config on runner. - - name: Set git config - run: | - git config --global user.email "google-oss-bot@example.com" - git config --global user.name "google-oss-bot" - - name: Update SpecsTesting repo - run: | - [[ ${{ matrix.allowwarnings }} == true ]] && ALLOWWARNINGS=true - cd scripts/create_spec_repo/ - swift build - pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsTesting.git - # ${ALLOWWARNINGS:+--allow-warnings} will add --allow-warnings to the - # command if ${ALLOWWARNINGS} is not null. - BOT_TOKEN="${botaccess}" ${GITHUB_WORKSPACE}/scripts/third_party/travis/retry.sh .build/debug/spec-repo-builder \ - --sdk-repo "${local_sdk_repo_dir}" \ - --local-spec-repo-name "${local_repo}" \ - --sdk-repo-name SpecsTesting \ - --github-account Firebase \ - --pod-sources 'https://${BOT_TOKEN}@github.com/Firebase/SpecsTesting' "https://github.com/firebase/SpecsDev.git" "https://github.com/firebase/SpecsStaging.git" "https://github.com/CocoaPods/Specs.git" \ - --include-pods "${targeted_pod}" \ - --keep-repo ${ALLOWWARNINGS:+--allow-warnings} - - name: Clean Artifacts - if: ${{ always() }} - run: pod repo remove "${local_repo}" - - update_SpecsTesting_repo: - # Don't run on private repo unless it is a PR. - if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.pull_request.merged == true - runs-on: macos-15 - env: - botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }} - local_repo: specstesting - podspec_repo_branch: main - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer - - name: Update SpecsTesting repo setup - run: | - # Update/create a nightly tag to the head of the main branch. - podspec_repo_branch="${podspec_repo_branch}" \ - scripts/release_testing_setup.sh prerelease_testing - env: - BOT_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Push updated podspecs - run: | - # Changes in post submit tests will be fetched by getting diff between - # the HEAD and HEAD^ of the main branch. - common_commit=$(git rev-parse HEAD^) - git diff --name-only $common_commit remotes/origin/${podspec_repo_branch} > updated_files.txt - updated_podspecs=() - while IFS= read -r line; - do - echo $line - if [ ${line: -8} == ".podspec" ] - then - updated_podspecs+=("$(basename -s .podspec ${line})") - fi - done < updated_files.txt - if [ -z "$updated_podspecs" ] - then - exit - fi - cd scripts/create_spec_repo/ - swift build - pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsTesting.git - BOT_TOKEN="${botaccess}" .build/debug/spec-repo-builder --sdk-repo $(pwd) --local-spec-repo-name "${local_repo}" --sdk-repo-name SpecsTesting --github-account Firebase --pod-sources 'https://${BOT_TOKEN}@github.com/Firebase/SpecsTesting' "https://github.com/firebase/SpecsDev.git" "https://github.com/firebase/SpecsStaging.git" "https://cdn.cocoapods.org/" "FirebaseFirestoreTestingSupport" "FirebaseAuthTestingSupport" "FirebaseCombineSwift" --keep-repo --include-pods "${updated_podspecs[@]}" - # TODO: The functions quickstart uses Material which isn't supported by Xcode 15 #functions_quickstart: # Don't run on private repo unless it is a PR. @@ -223,7 +30,6 @@ jobs: # env: # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} # botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }} - # LEGACY: true # # TODO: The functions quickstart uses Material which isn't supported by Xcode 15 # runs-on: macos-12 # steps: @@ -255,16 +61,17 @@ jobs: quickstart: # Don't run on private repo unless it is a PR. - if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch' - needs: buildup_SpecsTesting_repo + if: | + github.repository == 'firebase/firebase-ios-sdk' && + contains(fromJSON('["schedule", "pull_request", "workflow_dispatch"]'), github.event_name) strategy: + fail-fast: false matrix: include: - product: Performance run_tests: true - product: Storage - is_legacy: true - run_tests: true + run_tests: false - product: Config run_tests: true - product: Messaging @@ -278,50 +85,42 @@ jobs: - product: Authentication run_tests: false - product: Crashlytics - is_legacy: true run_tests: true - setup_command: | - mkdir -p quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics - # Set the deployed pod location of run and upload-symbols with the development pod version. - cp Crashlytics/run quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/ - cp Crashlytics/upload-symbols quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/ - product: ABTesting - is_legacy: true run_tests: true + name: 'quickstart (prerelease, ${{ matrix.product }}, run_tests: ${{ matrix.run_tests }})' env: plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }} - LEGACY: ${{ matrix.is_legacy && true || '' }} runs-on: macos-15 steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1 + - name: Prereqs + run: gem install xcpretty - name: Xcode run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer - name: Setup testing repo and quickstart - run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh ${{ matrix.product }} prerelease_testing + run: QUICKSTART_BRANCH=nc/quickstarts scripts/setup_quickstart_spm.sh ${{ matrix.product }} prerelease_testing - name: Install Secret GoogleService-Info.plist run: | scripts/decrypt_gha_secret.sh \ scripts/gha-encrypted/qs-${{ matrix.product }}.plist.gpg \ quickstart-ios/${{ matrix.product }}/GoogleService-Info.plist \ "$plist_secret" - - name: Run setup command, if needed. - if: matrix.setup_command != '' - run: ${{ matrix.setup_command }} - name: Build Quickstart uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 with: timeout_minutes: 15 max_attempts: 3 retry_wait_seconds: 120 - command: scripts/test_quickstart.sh ${{ matrix.product }} ${{ matrix.run_tests }} + command: DIR=${{ matrix.product }} scripts/test_quickstart.sh ${{ matrix.product }} ${{ matrix.run_tests }} # Failure sequence to upload artifact. - name: Remove data before upload. - if: ${{ failure() }} + # if: ${{ failure() }} run: scripts/remove_data.sh ${{ matrix.product }} - - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: quickstart_artifacts_${{ matrix.product }} - path: quickstart-ios/ + # - uses: actions/upload-artifact@v4 + # if: ${{ failure() }} + # with: + # name: quickstart_artifacts_${{ matrix.product }} + # path: quickstart-ios/ diff --git a/.github/workflows/prerelease_cocoapods.yml b/.github/workflows/prerelease_cocoapods.yml new file mode 100644 index 00000000000..684716b9c8b --- /dev/null +++ b/.github/workflows/prerelease_cocoapods.yml @@ -0,0 +1,216 @@ +name: prerelease_cocoapods + +permissions: + contents: write + +on: + pull_request: + # closed will be triggered when a pull request is merged. This is to keep https://github.com/firebase/SpecsTesting up to date. + types: [closed] + paths: + - '.github/workflows/prerelease_cocoapods.yml' + workflow_dispatch: + schedule: + # Run every day at 10pm (PDT) / 1am (EDT) - cron uses UTC times + - cron: '0 5 * * *' + +env: + FIREBASE_CI: true + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + specs_checking: + # Don't run on private repo unless it is a PR. + if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch' + runs-on: macos-15 + env: + botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }} + local_repo: specstesting + podspec_repo_branch: main + outputs: + matrix: ${{ steps.generate_matrix.outputs.matrix }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Required for pulling down repo tags. + - name: Xcode + run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer + - name: Generate matrix + id: generate_matrix + run: | + cd "${GITHUB_WORKSPACE}/ReleaseTooling" + swift run manifest --sdk-repo-url "${GITHUB_WORKSPACE}" --output-file-path ./output.json --for-gha-matrix-generation + echo "::set-output name=matrix::{\"include\":$( cat output.json )}" + - name: Update SpecsTesting repo setup + run: | + podspec_repo_branch="${podspec_repo_branch}" \ + scripts/release_testing_setup.sh prerelease_testing + env: + BOT_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Clean spec repo + run: | + git clone --quiet https://${botaccess}@github.com/Firebase/SpecsTesting.git "${local_repo}" + cd "${local_repo}" + # Remove all unhidden dirs, i.e. all podspec dir from the spec repo. + rm -Rf -- */ + git add . + # commit without diff will throw an error. `git diff --exit-code` can avoid such error. + git diff --staged --exit-code || git commit -m "Empty spec repo." + # Attempt to push. If it fails, print a detailed error message and exit. + git push || { + echo "--------------------------------------------------------------------------------" + echo "ERROR: Failed to push to Firebase/SpecsTesting." + echo "This is likely due to an expired Personal Access Token (PAT)." + echo "Please take the following steps to resolve this:" + echo "1. Refresh the OSS bot's scoped access token for the Firebase/SpecsTesting repo." + echo " This can be done in the OSS bot's GitHub account settings. Ensure the token " + echo " has the 'public_repo' scope." + echo "2. Update the 'PRERELEASE_TESTING_PAT' secret in this repo's settings." + echo " (https://github.com/Firebase/firebase-ios-sdk/settings/secrets/actions)" + echo "--------------------------------------------------------------------------------" + exit 1 + } + - name: Clean Artifacts + if: ${{ always() }} + run: | + rm -rf prerelease-testing-token.txt + - uses: actions/upload-artifact@v4 + with: + name: firebase-ios-sdk + path: | + *.podspec + *.podspec.json + + buildup_SpecsTesting_repo_FirebaseCore: + needs: specs_checking + # Don't run on private repo unless it is a PR. + if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch' + runs-on: macos-15 + env: + botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }} + local_repo: specstesting + local_sdk_repo_dir: /tmp/test/firebase-ios-sdk + targeted_pod: FirebaseCore + steps: + - uses: actions/checkout@v4 + - name: Xcode + run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer + - uses: actions/download-artifact@v4.1.7 + with: + name: firebase-ios-sdk + path: ${{ env.local_sdk_repo_dir }} + # Addresses flaky pushes due to missing git config on runner. + - name: Set git config + run: | + git config --global user.email "google-oss-bot@example.com" + git config --global user.name "google-oss-bot" + - name: Update SpecsTesting repo + run: | + cd scripts/create_spec_repo/ + swift build + pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsTesting.git + BOT_TOKEN="${botaccess}" ${GITHUB_WORKSPACE}/scripts/third_party/travis/retry.sh .build/debug/spec-repo-builder \ + --sdk-repo "${local_sdk_repo_dir}" \ + --local-spec-repo-name "${local_repo}" \ + --sdk-repo-name SpecsTesting \ + --github-account Firebase \ + --pod-sources 'https://${BOT_TOKEN}@github.com/Firebase/SpecsTesting' "https://github.com/firebase/SpecsDev.git" "https://github.com/firebase/SpecsStaging.git" "https://github.com/CocoaPods/Specs.git" \ + --include-pods "${targeted_pod}" --keep-repo + - name: Clean Artifacts + if: ${{ always() }} + run: pod repo remove "${local_repo}" + + buildup_SpecsTesting_repo: + needs: [buildup_SpecsTesting_repo_FirebaseCore, specs_checking] + # Don't run on private repo unless it is a PR. + if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch' + runs-on: macos-15 + strategy: + fail-fast: false + matrix: ${{fromJson(needs.specs_checking.outputs.matrix)}} + env: + botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }} + local_repo: specstesting + local_sdk_repo_dir: /tmp/test/firebase-ios-sdk + targeted_pod: ${{ matrix.podspec }} + steps: + - uses: actions/checkout@v4 + - name: Xcode + run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer + - uses: actions/download-artifact@v4.1.7 + with: + name: firebase-ios-sdk + path: ${{ env.local_sdk_repo_dir }} + # Addresses flaky pushes due to missing git config on runner. + - name: Set git config + run: | + git config --global user.email "google-oss-bot@example.com" + git config --global user.name "google-oss-bot" + - name: Update SpecsTesting repo + run: | + [[ ${{ matrix.allowwarnings }} == true ]] && ALLOWWARNINGS=true + cd scripts/create_spec_repo/ + swift build + pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsTesting.git + # ${ALLOWWARNINGS:+--allow-warnings} will add --allow-warnings to the + # command if ${ALLOWWARNINGS} is not null. + BOT_TOKEN="${botaccess}" ${GITHUB_WORKSPACE}/scripts/third_party/travis/retry.sh .build/debug/spec-repo-builder \ + --sdk-repo "${local_sdk_repo_dir}" \ + --local-spec-repo-name "${local_repo}" \ + --sdk-repo-name SpecsTesting \ + --github-account Firebase \ + --pod-sources 'https://${BOT_TOKEN}@github.com/Firebase/SpecsTesting' "https://github.com/firebase/SpecsDev.git" "https://github.com/firebase/SpecsStaging.git" "https://github.com/CocoaPods/Specs.git" \ + --include-pods "${targeted_pod}" \ + --keep-repo ${ALLOWWARNINGS:+--allow-warnings} + - name: Clean Artifacts + if: ${{ always() }} + run: pod repo remove "${local_repo}" + + update_SpecsTesting_repo: + # Don't run on private repo unless it is a PR. + if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.pull_request.merged == true + runs-on: macos-15 + env: + botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }} + local_repo: specstesting + podspec_repo_branch: main + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Required for pulling down repo tags. + - name: Xcode + run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer + - name: Update SpecsTesting repo setup + run: | + # Update/create a nightly tag to the head of the main branch. + podspec_repo_branch="${podspec_repo_branch}" \ + scripts/release_testing_setup.sh prerelease_testing + env: + BOT_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Push updated podspecs + run: | + # Changes in post submit tests will be fetched by getting diff between + # the HEAD and HEAD^ of the main branch. + common_commit=$(git rev-parse HEAD^) + git diff --name-only $common_commit remotes/origin/${podspec_repo_branch} > updated_files.txt + updated_podspecs=() + while IFS= read -r line; + do + echo $line + if [ ${line: -8} == ".podspec" ] + then + updated_podspecs+=("$(basename -s .podspec ${line})") + fi + done < updated_files.txt + if [ -z "$updated_podspecs" ] + then + exit + fi + cd scripts/create_spec_repo/ + swift build + pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsTesting.git + BOT_TOKEN="${botaccess}" .build/debug/spec-repo-builder --sdk-repo $(pwd) --local-spec-repo-name "${local_repo}" --sdk-repo-name SpecsTesting --github-account Firebase --pod-sources 'https://${BOT_TOKEN}@github.com/Firebase/SpecsTesting' "https://github.com/firebase/SpecsDev.git" "https://github.com/firebase/SpecsStaging.git" "https://cdn.cocoapods.org/" "FirebaseFirestoreTestingSupport" "FirebaseAuthTestingSupport" "FirebaseCombineSwift" --keep-repo --include-pods "${updated_podspecs[@]}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7441a5a5dba..92a71e0f392 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,6 @@ permissions: on: pull_request: paths: - - 'scripts/release_testing_setup.sh' - '.github/workflows/release.yml' - 'Gemfile*' workflow_dispatch: @@ -22,149 +21,52 @@ concurrency: cancel-in-progress: true jobs: - specs_checking: - # Don't run on private repo unless it is a PR. - if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch' - runs-on: macos-14 - env: - botaccess: ${{ secrets.RELEASE_TESTING_PAT }} - local_repo: specsreleasing - podspec_repo_branch: main - outputs: - matrix: ${{ steps.generate_matrix.outputs.matrix }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Generate matrix - id: generate_matrix - run: | - cd "${GITHUB_WORKSPACE}/ReleaseTooling" - swift run manifest --sdk-repo-url "${GITHUB_WORKSPACE}" --output-file-path ./output.json --for-gha-matrix-generation - echo "::set-output name=matrix::{\"include\":$( cat output.json )}" - - name: Update SpecsReleasing repo setup - run: | - podspec_repo_branch="${podspec_repo_branch}" \ - scripts/release_testing_setup.sh release_testing - - name: Clean spec repo - run: | - git clone --quiet https://"$botaccess"@github.com/Firebase/SpecsReleasing.git "${local_repo}" - cd "${local_repo}" - # Remove all unhidden dirs, i.e. all podspec dir from the spec repo. - rm -Rf -- */ - git add . - # commit without diff will throw an error. `git diff --exit-code` can avoid such error. - git diff --staged --exit-code || git commit -m "Empty spec repo." - # Attempt to push. If it fails, print a detailed error message and exit. - git push || { - echo "--------------------------------------------------------------------------------" - echo "ERROR: Failed to push to Firebase/SpecsReleasing." - echo "This is likely due to an expired Personal Access Token (PAT)." - echo "Please take the following steps to resolve this:" - echo "1. Refresh the OSS bot's scoped access token for the Firebase/SpecsReleasing repo." - echo " This can be done in the OSS bot's GitHub account settings. Ensure the token " - echo " has the 'public_repo' scope." - echo "2. Update the 'RELEASE_TESTING_PAT' secret in this repo's settings." - echo " (https://github.com/Firebase/firebase-ios-sdk/settings/secrets/actions)" - echo "--------------------------------------------------------------------------------" - exit 1 - } - - uses: actions/upload-artifact@v4 - with: - name: firebase-ios-sdk - path: | - *.podspec - *.podspec.json - - buildup_SpecsReleasing_repo_FirebaseCore: - needs: specs_checking - # Don't run on private repo unless it is a PR. - if: github.repository == 'Firebase/firebase-ios-sdk' - runs-on: macos-15 - env: - botaccess: ${{ secrets.RELEASE_TESTING_PAT }} - local_repo: specsreleasing - local_sdk_repo_dir: /tmp/test/firebase-ios-sdk - targeted_pod: FirebaseCore - steps: - - uses: actions/checkout@v4 - - name: Set Xcode version - run: sudo xcode-select -s /Applications/Xcode_16.4.app - - uses: actions/download-artifact@v4.1.7 - with: - name: firebase-ios-sdk - path: ${{ env.local_sdk_repo_dir }} - - name: Update SpecsReleasing repo - run: | - cd scripts/create_spec_repo/ - swift build - pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsReleasing.git - BOT_TOKEN="${botaccess}" ${GITHUB_WORKSPACE}/scripts/third_party/travis/retry.sh .build/debug/spec-repo-builder \ - --sdk-repo "${local_sdk_repo_dir}" \ - --local-spec-repo-name "${local_repo}" \ - --pod-sources 'https://github.com/Firebase/SpecsReleasing' "https://github.com/firebase/SpecsStaging.git" "https://github.com/CocoaPods/Specs.git" \ - --include-pods "${targeted_pod}" --keep-repo - - name: Clean Artifacts - if: ${{ always() }} - run: pod repo remove "${local_repo}" - - buildup_SpecsReleasing_repo: - needs: [buildup_SpecsReleasing_repo_FirebaseCore, specs_checking] - # Don't run on private repo unless it is a PR. - if: github.repository == 'Firebase/firebase-ios-sdk' || github.event_name == 'workflow_dispatch' - runs-on: macos-15 - strategy: - fail-fast: false - matrix: ${{fromJson(needs.specs_checking.outputs.matrix)}} - env: - botaccess: ${{ secrets.RELEASE_TESTING_PAT }} - local_repo: specsreleasing - local_sdk_repo_dir: /tmp/test/firebase-ios-sdk - targeted_pod: ${{ matrix.podspec }} - steps: - - uses: actions/checkout@v4 - - name: Set Xcode version - run: sudo xcode-select -s /Applications/Xcode_16.4.app - - uses: actions/download-artifact@v4.1.7 - with: - name: firebase-ios-sdk - path: ${{ env.local_sdk_repo_dir }} - # Addresses flaky pushes due to missing git config on runner. - - name: Set git config - run: | - git config --global user.email "google-oss-bot@example.com" - git config --global user.name "google-oss-bot" - - name: Update SpecsReleasing repo - run: | - [[ ${{ matrix.allowwarnings }} == true ]] && ALLOWWARNINGS=true - cd scripts/create_spec_repo/ - swift build - pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsReleasing.git - # ${ALLOWWARNINGS:+--allow-warnings} will add --allow-warnings to the - # command if ${ALLOWWARNINGS} is not null. - BOT_TOKEN="${botaccess}" ${GITHUB_WORKSPACE}/scripts/third_party/travis/retry.sh .build/debug/spec-repo-builder \ - --sdk-repo "${local_sdk_repo_dir}" \ - --local-spec-repo-name "${local_repo}" \ - --pod-sources 'https://github.com/Firebase/SpecsReleasing' "https://github.com/firebase/SpecsStaging.git" "https://github.com/CocoaPods/Specs.git" \ - --include-pods "${targeted_pod}" \ - --keep-repo ${ALLOWWARNINGS:+--allow-warnings} - - name: Clean Artifacts - if: ${{ always() }} - run: pod repo remove "${local_repo}" + # TODO: The functions quickstart uses Material which isn't supported by Xcode 15 + # functions_quickstart: + # # Don't run on private repo unless it is a PR. + # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' + # needs: buildup_SpecsReleasing_repo + # env: + # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} + # botaccess: ${{ secrets.RELEASE_TESTING_PAT }} + # runs-on: macos-12 + # steps: + # - uses: actions/checkout@v4 + # - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1 + # - name: Setup testing repo and quickstart + # run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh functions nightly_release_testing + # - name: install secret googleservice-info.plist + # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \ + # quickstart-ios/functions/GoogleService-Info.plist "$plist_secret" + # - name: Setup custom URL scheme + # run: sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist + # - name: Test objc quickstart + # run: ([ -z $plist_secret ] || + # scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true) + # - name: Test swift quickstart + # run: ([ -z $plist_secret ] || + # scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true swift) + # - name: Remove data before upload + # if: ${{ failure() }} + # run: scripts/remove_data.sh functions + # - uses: actions/upload-artifact@v4 + # if: ${{ failure() }} + # with: + # name: quickstart_artifacts_functions + # path: quickstart-ios/ quickstart: - # Don't run on private repo unless it is a PR. - if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch' - needs: buildup_SpecsReleasing_repo + if: | + github.repository == 'firebase/firebase-ios-sdk' && + contains(fromJSON('["schedule", "pull_request", "workflow_dispatch"]'), github.event_name) strategy: + fail-fast: false matrix: include: - product: Performance run_tests: true - product: Storage - run_tests: true - is_legacy: true + run_tests: false - product: Config run_tests: true - product: Messaging @@ -179,81 +81,40 @@ jobs: run_tests: false - product: Crashlytics run_tests: true - is_legacy: true - setup_command: | - mkdir -p quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics - # Set the deployed pod location of run and upload-symbols with the development pod version. - cp Crashlytics/run quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/ - cp Crashlytics/upload-symbols quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/ - product: ABTesting run_tests: true - is_legacy: true + name: 'quickstart (release, ${{ matrix.product }}, run_tests: ${{ matrix.run_tests }})' env: plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} botaccess: ${{ secrets.RELEASE_TESTING_PAT }} - LEGACY: ${{ matrix.is_legacy && true || '' }} runs-on: macos-15 steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Required for pulling down repo tags. - name: Set Xcode version run: sudo xcode-select -s /Applications/Xcode_16.4.app - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1 + - name: Prereqs + run: gem install xcpretty - name: Setup testing repo and quickstart - run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh ${{ matrix.product }} nightly_release_testing + run: QUICKSTART_BRANCH=nc/quickstarts scripts/setup_quickstart_spm.sh ${{ matrix.product }} nightly_release_testing - name: Install Secret GoogleService-Info.plist run: | scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-${{ matrix.product }}.plist.gpg \ quickstart-ios/${{ matrix.product }}/GoogleService-Info.plist "$plist_secret" - - name: Run setup command, if needed. - if: matrix.setup_command != '' - run: ${{ matrix.setup_command }} - name: Build Quickstart uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 with: timeout_minutes: 15 max_attempts: 3 retry_wait_seconds: 120 - command: scripts/test_quickstart.sh ${{ matrix.product }} ${{ matrix.run_tests }} + command: DIR=${{ matrix.product }} scripts/test_quickstart.sh ${{ matrix.product }} ${{ matrix.run_tests }} - name: Remove data before upload - if: ${{ failure() }} + # if: ${{ failure() }} run: scripts/remove_data.sh ${{ matrix.product }} - - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: quickstart_artifacts_${{ matrix.product }} - path: quickstart-ios/ - - # TODO: The functions quickstart uses Material which isn't supported by Xcode 15 - # functions_quickstart: - # # Don't run on private repo unless it is a PR. - # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' - # needs: buildup_SpecsReleasing_repo - # env: - # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} - # botaccess: ${{ secrets.RELEASE_TESTING_PAT }} - # LEGACY: true - # runs-on: macos-12 - # steps: - # - uses: actions/checkout@v4 - # - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1 - # - name: Setup testing repo and quickstart - # run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh functions nightly_release_testing - # - name: install secret googleservice-info.plist - # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \ - # quickstart-ios/functions/GoogleService-Info.plist "$plist_secret" - # - name: Setup custom URL scheme - # run: sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist - # - name: Test objc quickstart - # run: ([ -z $plist_secret ] || - # scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true) - # - name: Test swift quickstart - # run: ([ -z $plist_secret ] || - # scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true swift) - # - name: Remove data before upload - # if: ${{ failure() }} - # run: scripts/remove_data.sh functions - # - uses: actions/upload-artifact@v4 - # if: ${{ failure() }} - # with: - # name: quickstart_artifacts_functions - # path: quickstart-ios/ + # - uses: actions/upload-artifact@v4 + # if: ${{ failure() }} + # with: + # name: quickstart_artifacts_${{ matrix.product }} + # path: quickstart-ios/ diff --git a/.github/workflows/release_cocoapods.yml b/.github/workflows/release_cocoapods.yml new file mode 100644 index 00000000000..c75b089802c --- /dev/null +++ b/.github/workflows/release_cocoapods.yml @@ -0,0 +1,154 @@ +name: release_cocoapods + +permissions: + contents: read + +on: + pull_request: + paths: + - 'scripts/release_testing_setup.sh' + - '.github/workflows/release_cocoapods.yml' + - 'Gemfile*' + workflow_dispatch: + schedule: + # Run every day at 10pm (PDT) / 1am (EDT) - cron uses UTC times + - cron: '0 5 * * *' + +env: + FIREBASE_CI: true + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + specs_checking: + # Don't run on private repo unless it is a PR. + if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch' + runs-on: macos-14 + env: + botaccess: ${{ secrets.RELEASE_TESTING_PAT }} + local_repo: specsreleasing + podspec_repo_branch: main + outputs: + matrix: ${{ steps.generate_matrix.outputs.matrix }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Required for pulling down repo tags. + - name: Generate matrix + id: generate_matrix + run: | + cd "${GITHUB_WORKSPACE}/ReleaseTooling" + swift run manifest --sdk-repo-url "${GITHUB_WORKSPACE}" --output-file-path ./output.json --for-gha-matrix-generation + echo "::set-output name=matrix::{\"include\":$( cat output.json )}" + - name: Update SpecsReleasing repo setup + run: | + podspec_repo_branch="${podspec_repo_branch}" \ + scripts/release_testing_setup.sh release_testing + - name: Clean spec repo + run: | + git clone --quiet https://"$botaccess"@github.com/Firebase/SpecsReleasing.git "${local_repo}" + cd "${local_repo}" + # Remove all unhidden dirs, i.e. all podspec dir from the spec repo. + rm -Rf -- */ + git add . + # commit without diff will throw an error. `git diff --exit-code` can avoid such error. + git diff --staged --exit-code || git commit -m "Empty spec repo." + # Attempt to push. If it fails, print a detailed error message and exit. + git push || { + echo "--------------------------------------------------------------------------------" + echo "ERROR: Failed to push to Firebase/SpecsReleasing." + echo "This is likely due to an expired Personal Access Token (PAT)." + echo "Please take the following steps to resolve this:" + echo "1. Refresh the OSS bot's scoped access token for the Firebase/SpecsReleasing repo." + echo " This can be done in the OSS bot's GitHub account settings. Ensure the token " + echo " has the 'public_repo' scope." + echo "2. Update the 'RELEASE_TESTING_PAT' secret in this repo's settings." + echo " (https://github.com/Firebase/firebase-ios-sdk/settings/secrets/actions)" + echo "--------------------------------------------------------------------------------" + exit 1 + } + - uses: actions/upload-artifact@v4 + with: + name: firebase-ios-sdk + path: | + *.podspec + *.podspec.json + + buildup_SpecsReleasing_repo_FirebaseCore: + needs: specs_checking + # Don't run on private repo unless it is a PR. + if: github.repository == 'Firebase/firebase-ios-sdk' + runs-on: macos-15 + env: + botaccess: ${{ secrets.RELEASE_TESTING_PAT }} + local_repo: specsreleasing + local_sdk_repo_dir: /tmp/test/firebase-ios-sdk + targeted_pod: FirebaseCore + steps: + - uses: actions/checkout@v4 + - name: Set Xcode version + run: sudo xcode-select -s /Applications/Xcode_16.4.app + - uses: actions/download-artifact@v4.1.7 + with: + name: firebase-ios-sdk + path: ${{ env.local_sdk_repo_dir }} + - name: Update SpecsReleasing repo + run: | + cd scripts/create_spec_repo/ + swift build + pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsReleasing.git + BOT_TOKEN="${botaccess}" ${GITHUB_WORKSPACE}/scripts/third_party/travis/retry.sh .build/debug/spec-repo-builder \ + --sdk-repo "${local_sdk_repo_dir}" \ + --local-spec-repo-name "${local_repo}" \ + --pod-sources 'https://github.com/Firebase/SpecsReleasing' "https://github.com/firebase/SpecsStaging.git" "https://github.com/CocoaPods/Specs.git" \ + --include-pods "${targeted_pod}" --keep-repo + - name: Clean Artifacts + if: ${{ always() }} + run: pod repo remove "${local_repo}" + + buildup_SpecsReleasing_repo: + needs: [buildup_SpecsReleasing_repo_FirebaseCore, specs_checking] + # Don't run on private repo unless it is a PR. + if: github.repository == 'Firebase/firebase-ios-sdk' || github.event_name == 'workflow_dispatch' + runs-on: macos-15 + strategy: + fail-fast: false + matrix: ${{fromJson(needs.specs_checking.outputs.matrix)}} + env: + botaccess: ${{ secrets.RELEASE_TESTING_PAT }} + local_repo: specsreleasing + local_sdk_repo_dir: /tmp/test/firebase-ios-sdk + targeted_pod: ${{ matrix.podspec }} + steps: + - uses: actions/checkout@v4 + - name: Set Xcode version + run: sudo xcode-select -s /Applications/Xcode_16.4.app + - uses: actions/download-artifact@v4.1.7 + with: + name: firebase-ios-sdk + path: ${{ env.local_sdk_repo_dir }} + # Addresses flaky pushes due to missing git config on runner. + - name: Set git config + run: | + git config --global user.email "google-oss-bot@example.com" + git config --global user.name "google-oss-bot" + - name: Update SpecsReleasing repo + run: | + [[ ${{ matrix.allowwarnings }} == true ]] && ALLOWWARNINGS=true + cd scripts/create_spec_repo/ + swift build + pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsReleasing.git + # ${ALLOWWARNINGS:+--allow-warnings} will add --allow-warnings to the + # command if ${ALLOWWARNINGS} is not null. + BOT_TOKEN="${botaccess}" ${GITHUB_WORKSPACE}/scripts/third_party/travis/retry.sh .build/debug/spec-repo-builder \ + --sdk-repo "${local_sdk_repo_dir}" \ + --local-spec-repo-name "${local_repo}" \ + --pod-sources 'https://github.com/Firebase/SpecsReleasing' "https://github.com/firebase/SpecsStaging.git" "https://github.com/CocoaPods/Specs.git" \ + --include-pods "${targeted_pod}" \ + --keep-repo ${ALLOWWARNINGS:+--allow-warnings} + - name: Clean Artifacts + if: ${{ always() }} + run: pod repo remove "${local_repo}" diff --git a/.github/workflows/remoteconfig.yml b/.github/workflows/remoteconfig.yml index 5588a70ce5b..68d0bb7512a 100644 --- a/.github/workflows/remoteconfig.yml +++ b/.github/workflows/remoteconfig.yml @@ -94,8 +94,7 @@ jobs: uses: ./.github/workflows/common_quickstart.yml with: product: Config - is_legacy: false - setup_command: QUICKSTART_BRANCH=nc/quickstarts scripts/setup_quickstart_spm.sh config + setup_command: scripts/setup_quickstart_spm.sh config plist_src_path: scripts/gha-encrypted/qs-config.plist.gpg plist_dst_path: quickstart-ios/config/GoogleService-Info.plist secrets: diff --git a/.github/workflows/storage.yml b/.github/workflows/storage.yml index 6e61def84d8..95545b39a97 100644 --- a/.github/workflows/storage.yml +++ b/.github/workflows/storage.yml @@ -83,8 +83,7 @@ jobs: uses: ./.github/workflows/common_quickstart.yml with: product: Storage - is_legacy: true - setup_command: QUICKSTART_BRANCH=nc/quickstarts scripts/setup_quickstart_spm.sh storage + setup_command: scripts/setup_quickstart_spm.sh storage plist_src_path: scripts/gha-encrypted/qs-storage.plist.gpg plist_dst_path: quickstart-ios/storage/GoogleService-Info.plist run_tests: false @@ -96,7 +95,6 @@ jobs: # if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule' # env: # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} - # LEGACY: true # runs-on: macos-15 # steps: # - uses: actions/checkout@v4 diff --git a/.github/workflows/zip.yml b/.github/workflows/zip.yml index eba3c5b61b5..570bce868fd 100644 --- a/.github/workflows/zip.yml +++ b/.github/workflows/zip.yml @@ -1,5 +1,7 @@ name: zip +# TODO(ncooke3): Add FirebaseAI test. + permissions: actions: read contents: read @@ -147,8 +149,6 @@ jobs: find "${GITHUB_WORKSPACE}" -name "Firebase*latest.zip" -exec unzip -d "${HOME}"/ios_frameworks/ {} + - uses: actions/checkout@v4 - name: Setup quickstart - env: - LEGACY: true run: SAMPLE="$SDK" TARGET="${SDK}Example" scripts/setup_quickstart_framework.sh \ "${HOME}"/ios_frameworks/Firebase/FirebaseRemoteConfig/* \ "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseCore.xcframework \ @@ -160,19 +160,15 @@ jobs: run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \ quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret" - name: Test Quickstart - env: - LEGACY: true run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_framework.sh "${SDK}") - name: Remove data before upload - env: - LEGACY: true if: ${{ failure() }} run: scripts/remove_data.sh abtesting - - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: quickstart_artifacts_abtesting - path: quickstart-ios/ + # - uses: actions/upload-artifact@v4 + # if: ${{ failure() }} + # with: + # name: quickstart_artifacts_abtesting + # path: quickstart-ios/ quickstart_framework_auth: needs: package-head @@ -219,11 +215,11 @@ jobs: - name: Remove data before upload if: ${{ failure() }} run: scripts/remove_data.sh authentiation - - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: quickstart_artifacts_auth - path: quickstart-ios/ + # - uses: actions/upload-artifact@v4 + # if: ${{ failure() }} + # with: + # name: quickstart_artifacts_auth + # path: quickstart-ios/ quickstart_framework_config: needs: package-head @@ -268,11 +264,11 @@ jobs: - name: Remove data before upload if: ${{ failure() }} run: scripts/remove_data.sh config - - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: quickstart_artifacts_config - path: quickstart-ios/ + # - uses: actions/upload-artifact@v4 + # if: ${{ failure() }} + # with: + # name: quickstart_artifacts_config + # path: quickstart-ios/ quickstart_framework_crashlytics: needs: package-head @@ -306,8 +302,6 @@ jobs: find "${GITHUB_WORKSPACE}" -name "Firebase*latest.zip" -exec unzip -d "${HOME}"/ios_frameworks/ {} + - uses: actions/checkout@v4 - name: Setup quickstart - env: - LEGACY: true run: | SAMPLE="$SDK" TARGET="${SDK}Example" scripts/setup_quickstart_framework.sh \ "${HOME}"/ios_frameworks/Firebase/FirebaseCrashlytics/* \ @@ -327,8 +321,6 @@ jobs: run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-crashlytics.plist.gpg \ quickstart-ios/crashlytics/GoogleService-Info.plist "$plist_secret" - name: Test Quickstart - env: - LEGACY: true run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_framework.sh "${SDK}") # TODO(#8057): Restore Swift Quickstart # - name: Test Swift Quickstart @@ -336,15 +328,13 @@ jobs: # LEGACY: true # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_framework.sh "${SDK}" swift) - name: Remove data before upload - env: - LEGACY: true if: ${{ failure() }} run: scripts/remove_data.sh crashlytics - - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: quickstart_artifacts_crashlytics - path: quickstart-ios/ + # - uses: actions/upload-artifact@v4 + # if: ${{ failure() }} + # with: + # name: quickstart_artifacts_crashlytics + # path: quickstart-ios/ quickstart_framework_database: needs: package-head @@ -392,11 +382,11 @@ jobs: - name: Remove data before upload if: ${{ failure() }} run: scripts/remove_data.sh database - - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: quickstart_artifacts database - path: quickstart-ios/ + # - uses: actions/upload-artifact@v4 + # if: ${{ failure() }} + # with: + # name: quickstart_artifacts database + # path: quickstart-ios/ quickstart_framework_firestore: needs: package-head @@ -449,11 +439,11 @@ jobs: - name: Remove data before upload and zip directory to reduce upload size. if: ${{ failure() }} run: scripts/remove_data.sh firestore; zip -r --symlinks quickstart_artifacts_firestore.zip quickstart-ios/ - - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: quickstart_artifacts_firestore_${{ matrix.artifact }}_${{ matrix.build-env.os }} - path: quickstart_artifacts_firestore.zip + # - uses: actions/upload-artifact@v4 + # if: ${{ failure() }} + # with: + # name: quickstart_artifacts_firestore_${{ matrix.artifact }}_${{ matrix.build-env.os }} + # path: quickstart_artifacts_firestore.zip check_framework_firestore_symbols: needs: package-head @@ -534,11 +524,11 @@ jobs: - name: Remove data before upload if: ${{ failure() }} run: scripts/remove_data.sh inappmessaging - - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: quickstart_artifacts_inappmessaging - path: quickstart-ios/ + # - uses: actions/upload-artifact@v4 + # if: ${{ failure() }} + # with: + # name: quickstart_artifacts_inappmessaging + # path: quickstart-ios/ quickstart_framework_messaging: needs: package-head @@ -587,11 +577,11 @@ jobs: - name: Remove data before upload if: ${{ failure() }} run: scripts/remove_data.sh messaging - - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: quickstart_artifacts_messaging - path: quickstart-ios/ + # - uses: actions/upload-artifact@v4 + # if: ${{ failure() }} + # with: + # name: quickstart_artifacts_messaging + # path: quickstart-ios/ quickstart_framework_storage: needs: package-head @@ -625,34 +615,24 @@ jobs: find "${GITHUB_WORKSPACE}" -name "Firebase*latest.zip" -exec unzip -d "${HOME}"/ios_frameworks/ {} + - uses: actions/checkout@v4 - name: Setup quickstart - env: - LEGACY: true run: SAMPLE="$SDK" TARGET="${SDK}Example" scripts/setup_quickstart_framework.sh \ "${HOME}"/ios_frameworks/Firebase/FirebaseStorage/* \ "${HOME}"/ios_frameworks/Firebase/FirebaseAuth/* \ "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/* - name: Setup swift quickstart - env: - LEGACY: true run: SAMPLE="$SDK" TARGET="${SDK}ExampleSwift" scripts/setup_quickstart_framework.sh - name: Install Secret GoogleService-Info.plist run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-storage.plist.gpg \ quickstart-ios/storage/GoogleService-Info.plist "$plist_secret" - name: Test Quickstart - env: - LEGACY: true run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_framework.sh "${SDK}") - name: Test Swift Quickstart - env: - LEGACY: true run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_framework.sh "${SDK}" swift) - name: Remove data before upload - env: - LEGACY: true if: ${{ failure() }} run: scripts/remove_data.sh storage - - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: quickstart_artifacts_storage - path: quickstart-ios/ + # - uses: actions/upload-artifact@v4 + # if: ${{ failure() }} + # with: + # name: quickstart_artifacts_storage + # path: quickstart-ios/ diff --git a/scripts/remove_data.sh b/scripts/remove_data.sh index 04dcf25ae8f..90abf99b50b 100755 --- a/scripts/remove_data.sh +++ b/scripts/remove_data.sh @@ -16,10 +16,20 @@ set -xe SDK="$1" +if [[ -z "$SDK" ]]; then + echo "Error: SDK name not provided." >&2 + echo "Usage: $0 " >&2 + exit 1 +fi + DIR="${SDK}" -if [[ ! -z "$LEGACY" ]]; then - DIR="${SDK}/Legacy${SDK}Quickstart" +TARGET_DIR="quickstart-ios/${DIR}" + +if [ ! -d "$TARGET_DIR" ]; then + echo "Error: Directory '$TARGET_DIR' not found." >&2 + echo "Please provide a valid SDK name." >&2 + exit 1 fi -rm -f quickstart-ios/"${DIR}"/GoogleService-Info.plist +rm -f "${TARGET_DIR}"/GoogleService-Info.plist diff --git a/scripts/setup_quickstart_spm.sh b/scripts/setup_quickstart_spm.sh index 4c3145e2d33..faf0224fec8 100755 --- a/scripts/setup_quickstart_spm.sh +++ b/scripts/setup_quickstart_spm.sh @@ -149,10 +149,13 @@ update_spm_dependency() { "${NIGHTLY_RELEASE_TESTING}") # For release testing, find the latest CocoaPods tag. local latest_tag - latest_tag=$(git -C "$root_dir" tag -l "CocoaPods-*" --sort=-v:refname | \ - grep -E '^CocoaPods-[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1) + latest_tag=$(git -C "$root_dir" tag -l "CocoaPods-*" --sort=-v:refname | + awk '/^CocoaPods-[0-9]+\.[0-9]+\.[0-9]+$/{print; exit}') if [[ -z "$latest_tag" ]]; then - echo "Error: Could not find a 'CocoaPods-X.Y.Z' tag." >&2 + echo "Error: Could not find the latest CocoaPods tag." >&2 + echo "This is often caused by a shallow git clone in a CI environment." >&2 + echo "If you are running in GitHub Actions, please ensure your checkout" >&2 + echo "step includes 'fetch-depth: 0' to fetch the full git history." >&2 exit 1 fi local tag_revision