|
41 | 41 | apk_path: distribution_apk_path, |
42 | 42 | app: firebase_app_id, # Firebase app id is required. Get it from google-services.json file |
43 | 43 | service_credentials_file: service_credentials_file_path, |
44 | | - groups: get_build_test_groups(), |
| 44 | + groups: get_build_test_groups(distribution_groups: arguments[:distribution_groups]), |
45 | 45 | release_notes: get_build_notes() |
46 | 46 | ) |
47 | 47 | end |
|
83 | 83 |
|
84 | 84 | firebase_app_distribution( |
85 | 85 | service_credentials_file: service_credentials_file_path, |
86 | | - groups: get_build_test_groups(), |
| 86 | + groups: get_build_test_groups(distribution_groups: arguments[:distribution_groups]), |
87 | 87 | release_notes: get_build_notes() |
88 | 88 | ) |
89 | 89 | end |
|
123 | 123 | build_notes # return value |
124 | 124 | end |
125 | 125 |
|
126 | | -lane :get_build_test_groups do |
127 | | - test_groups = ['all-builds'] # send all builds to group 'all-builds'. Therefore, set it here and we will not remove it. |
128 | | - 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. |
129 | | - github = GitHub.new() |
130 | | - |
131 | | - # 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. |
132 | | - # If a commit is merged into main, it's considered stable because we deploy to production on merges to main. |
133 | | - if github.is_commit_pushed && github.push_branch == "main" |
134 | | - test_groups.append("stable-builds") |
135 | | - test_groups.append("next") # Next group will depricate the 'stable` builds group'. |
136 | | - test_groups.append("public") # Temp send to public group until we actually build from the deployed SDK. |
137 | | - end |
138 | | - |
139 | | - test_groups = test_groups.join(", ") |
| 126 | +lane :get_build_test_groups do |arguments| |
| 127 | + # Firebase App Distribution expects a comma separated string of test group names. |
| 128 | + # If no groups are passed in, then set test groups to an empty string. |
| 129 | + test_groups = arguments[:distribution_groups] || "" |
140 | 130 |
|
141 | 131 | UI.important("Test group names that will be added to this build: #{test_groups}") |
142 | 132 |
|
143 | | - test_groups # return value |
144 | | -end |
| 133 | + test_groups # return value |
| 134 | +end |
| 135 | + |
0 commit comments