diff --git a/.gitignore b/.gitignore index f88b23b..a8a8311 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,8 @@ firebase-debug.log /flutter/fastlane/Preview.html # "scan" action temporary files. /flutter/fastlane/test_output +# fastlane updates the README templates way too often, resulting in CI failures. +/**/fastlane/README.md # File created by "flutter generate". /flutter/.packages.generated diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..35cdb86 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "dart.flutterSdkPath": "flutter/.flutter" +} diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 1983838..171cb52 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -18,20 +18,11 @@ lane :update do update_analysis_options Dir.chdir('..') do Dir.chdir('flutter') do - # This will automatically upgrade flutter, if necessary. It won't run - # "flutter update-packages", but we don't need it. - flutter_root = flutter_bootstrap(flutter_channel: 'stable') - - # Copy over .gitignore from official templates. - FileUtils.cp( - File.join( - flutter_root, - 'packages/flutter_tools/templates/app/.gitignore.tmpl', - ), - '.gitignore', - ) - Dir.chdir('fastlane') do + # This will automatically upgrade flutter, if necessary. It won't run + # "flutter update-packages", but we don't need it. + flutter_bootstrap(flutter_channel: 'stable') + # Upgrade current application packages (within pubspec.yaml spec). flutter(args: %w(packages upgrade)) end @@ -44,7 +35,9 @@ lane :update do if RUBY_PLATFORM.include? 'darwin' # These files will be automatically re-generated by the build. podfile_path = 'ios/Podfile' - File.delete(podfile_path, "#{podfile_path}.lock") + [podfile_path, "#{podfile_path}.lock"].each do |fn| + File.delete(fn) if File.exist?(fn) + end Dir.chdir('fastlane') do flutter_build( build: 'ios', @@ -136,7 +129,9 @@ INFO project_id = "#{product}-debug-#{_github_fork_name()}" sh %w(npm install) - Dir.chdir('functions') { sh %w(npm install) } + if File.directory?('functions') + Dir.chdir('functions') { sh %w(npm install) } + end fastlane_require 'shellwords' # Give Firebase login interactive mode and do not crop lines. exec %W(npm start -- #{project_id}).shelljoin diff --git a/flutter/fastlane/Fastfile b/flutter/fastlane/Fastfile index 73b2d10..7e265e2 100644 --- a/flutter/fastlane/Fastfile +++ b/flutter/fastlane/Fastfile @@ -281,6 +281,12 @@ platform :ios do if lane_context[SharedValues::PROMOTE_RELEASE] retry_on_exception do upload_to_app_store( + # Publishing to AppStore fails with message + # Precheck cannot check In-app purchases with the App Store + # Connect API Key + # Therefore we set this property to false as described here: + # https://github.com/fastlane/fastlane/issues/18250 + precheck_include_in_app_purchases: false, app_identifier: APP_IDENTIFIER, overwrite_screenshots: true, submit_for_review: true,