Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: customerio/customerio-flutter
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a873b8a5f8ad2895327df3e67d3a4127d501148c
Choose a base ref
..
head repository: customerio/customerio-flutter
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d0b71240c90b998a2086af1a591510f8e2f44ada
Choose a head ref
Showing with 33 additions and 19 deletions.
  1. +1 −1 .github/dependabot.yml
  2. +24 −0 .github/workflows/build-sample-apps.yml
  3. +8 −18 apps/fastlane/helpers/build_helper.rb
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ updates:
interval: "weekly"
open-pull-requests-limit: 1
reviewers:
- "customerio/mobile"
- "customerio/squad-mobile"
commit-message:
prefix: "chore"
include: "scope"
24 changes: 24 additions & 0 deletions .github/workflows/build-sample-apps.yml
Original file line number Diff line number Diff line change
@@ -65,6 +65,28 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set Default Firebase Distribution Groups
shell: bash
env:
# Distribution group constants
ALL_BUILDS_GROUP: all-builds
FEATURE_BUILDS_GROUP: feature-branch
NEXT_BUILDS_GROUP: next
PUBLIC_BUILDS_GROUP: public
# Input variables
CURRENT_BRANCH: ${{ github.ref }}
run: |
# Initialize with the default distribution group
distribution_groups=("$ALL_BUILDS_GROUP")
# Append distribution groups based on branch and context
[[ "$CURRENT_BRANCH" == "refs/heads/feature/"* ]] && distribution_groups+=("$FEATURE_BUILDS_GROUP")
[[ "$CURRENT_BRANCH" == "refs/heads/main" ]] && distribution_groups+=("$NEXT_BUILDS_GROUP")
[[ "$CURRENT_BRANCH" == "refs/heads/main" ]] && distribution_groups+=("$PUBLIC_BUILDS_GROUP")
# Export the groups as an environment variable
echo "firebase_distribution_groups=$(IFS=','; echo "${distribution_groups[*]}")" >> $GITHUB_ENV
# Install CLI tools, Ruby, and Ruby dependencies for Fastlane

- name: Install CLI tools used in CI script
@@ -136,6 +158,7 @@ jobs:
with:
subdirectory: apps/${{ matrix.sample-app }}
lane: 'android build'
options: '{"distribution_groups": "${{ env.firebase_distribution_groups }}"}'
env:
FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_CREDS_B64: ${{ secrets.FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_CREDS_B64 }}
continue-on-error: true # continue to build iOS app even if Android build fails
@@ -162,6 +185,7 @@ jobs:
with:
subdirectory: apps/${{ matrix.sample-app }}
lane: "ios build"
options: '{"distribution_groups": "${{ env.firebase_distribution_groups }}"}'
env:
GOOGLE_CLOUD_MATCH_READONLY_SERVICE_ACCOUNT_B64: ${{ secrets.GOOGLE_CLOUD_MATCH_READONLY_SERVICE_ACCOUNT_B64 }}
FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_CREDS_B64: ${{ secrets.FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_CREDS_B64 }}
26 changes: 8 additions & 18 deletions apps/fastlane/helpers/build_helper.rb
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
platform :android do
lane :build do |values|
build_notes = get_build_notes()
test_groups = get_build_test_groups()
test_groups = get_build_test_groups(distribution_groups: values[:distribution_groups])
app_package_name = CredentialsManager::AppfileConfig.try_fetch_value(:package_name) # get package_name from Appfile

# Firebase app id is required. Fetch it from google-services.json file using app_package_name
@@ -75,7 +75,7 @@

firebase_app_distribution(
service_credentials_file: service_credentials_file_path,
groups: get_build_test_groups(),
groups: get_build_test_groups(distribution_groups: arguments[:distribution_groups]),
release_notes: get_build_notes()
)
end
@@ -115,22 +115,12 @@
build_notes # return value
end

lane :get_build_test_groups do
test_groups = ['all-builds'] # send all builds to group 'all-builds'. Therefore, set it here and we will not remove it.
test_groups.append("feature-branch") # Feature branch will be used when a PR is merged into a feature branch. We will need to add a check for this.
github = GitHub.new()

# To avoid giving potentially unstable builds of our sample apps to certain members of the organization, we only send builds to "stable" group uncertain certain situations.
# If a commit is merged into main, it's considered stable because we deploy to production on merges to main.
if github.is_commit_pushed && github.push_branch == "main"
test_groups.append("stable-builds")
test_groups.append("next") # Next group will depricate the 'stable` builds group'.
test_groups.append("public") # Temp send to public group until we actually build from the deployed SDK.
end

test_groups = test_groups.join(", ")
lane :get_build_test_groups do |arguments|
# Firebase App Distribution expects a comma separated string of test group names.
# If no groups are passed in, then set test groups to an empty string.
test_groups = arguments[:distribution_groups] || ""

UI.important("Test group names that will be added to this build: #{test_groups}")

test_groups # return value
end
test_groups # return value
end