1# Prevent Fastlane from overwriting README.md 2skip_docs 3 4default_platform(:android) 5 6# This should be run after running 7# flutter build apk --release 8# to build the app using the Flutter toolchain. 9platform :android do 10 desc 'Push the built release APK to alpha or beta depending on current branch' 11 lane :deploy_play_store do 12 begin 13 upload_to_play_store( 14 track: 'alpha', 15 apk: '../build/app/outputs/apk/release/app-release.apk', 16 json_key_data: ENV['GOOGLE_DEVELOPER_SERVICE_ACCOUNT_ACTOR_FASTLANE'], 17 skip_upload_screenshots: true, 18 skip_upload_images: true 19 ) 20 rescue => exception 21 raise exception unless exception.message.include?('apkUpgradeVersionConflict') 22 puts 'Current version already present on the Play Store. Omitting this upload.' 23 end 24 end 25end 26