|
16 | 16 | default_platform(:android) |
17 | 17 |
|
18 | 18 | platform :android do |
| 19 | + desc 'Get the highest version code from all tracks' |
| 20 | + lane :version_code |options| |
| 21 | + production_versions = google_play_track_version_codes( |
| 22 | + package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', |
| 23 | + json_key: 'fastlane/play_store.json', |
| 24 | + track: 'production' |
| 25 | + ) |
| 26 | + |
| 27 | + beta_versions = google_play_track_version_codes( |
| 28 | + package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', |
| 29 | + json_key: 'fastlane/play_store.json', |
| 30 | + track: 'beta' |
| 31 | + ) |
| 32 | + |
| 33 | + alpha_versions = google_play_track_version_codes( |
| 34 | + package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', |
| 35 | + json_key: 'fastlane/play_store.json', |
| 36 | + track: 'alpha' |
| 37 | + ) |
| 38 | + |
| 39 | + internal_versions = google_play_track_version_codes( |
| 40 | + package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', |
| 41 | + json_key: 'fastlane/play_store.json', |
| 42 | + track: 'internal' |
| 43 | + ) |
| 44 | + |
| 45 | + all_versions = production_versions + beta_versions + alpha_versions + internal_versions |
| 46 | + highest_version = all_versions.max |
| 47 | + |
| 48 | + UI.message("All: #{all_versions}") |
| 49 | + UI.success("Highest: #{highest_version}") |
| 50 | + UI.success("Highest + 1: #{highest_version + 1}") |
| 51 | + |
| 52 | + next_version = highest_version + 1 |
| 53 | + |
| 54 | + puts next_version |
| 55 | + end |
| 56 | + |
19 | 57 | desc "Upload App to Play Store Internal (Circle CI)" |
20 | 58 | lane :beta_circle_ci do |options| |
21 | 59 | if options[:official] |
|
0 commit comments