diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 63410d8a3389..116c208e20c5 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -65,18 +65,18 @@ ENV["validate_translations"]="lintVanillaRelease" ##################################################################################### desc "Creates a new release branch from the current develop" lane :code_freeze do | options | - # gutenberg_dep_check() - old_version = 16.8 - - # android_bump_version_release() - new_version = 16.9 - # extract_release_notes_for_version(version: new_version, - # release_notes_file_path:"#{ENV["PROJECT_ROOT_FOLDER"]}RELEASE-NOTES.txt", - # extracted_notes_file_path:release_notes_path) - # cleanup_release_files(files: [release_note_short_path]) - # android_update_release_notes(new_version: new_version) - # setbranchprotection(repository:GHHELPER_REPO, branch: "release/#{new_version}") - # setfrozentag(repository:GHHELPER_REPO, milestone: new_version) + gutenberg_dep_check() + old_version = android_codefreeze_prechecks(options) + + android_bump_version_release() + new_version = android_get_app_version() + extract_release_notes_for_version(version: new_version, + release_notes_file_path:"#{ENV["PROJECT_ROOT_FOLDER"]}RELEASE-NOTES.txt", + extracted_notes_file_path:release_notes_path) + cleanup_release_files(files: [release_note_short_path]) + android_update_release_notes(new_version: new_version) + setbranchprotection(repository:GHHELPER_REPO, branch: "release/#{new_version}") + setfrozentag(repository:GHHELPER_REPO, milestone: new_version) localize_gutenberg(skip_module_update: true) localize_libs() @@ -193,7 +193,7 @@ ENV["validate_translations"]="lintVanillaRelease" ##################################################################################### # finalize_hotfix_release # ----------------------------------------------------------------------------------- - # This lane finalizes the hotfix branch. + # This lane finalizes the hotfix branch. # ----------------------------------------------------------------------------------- # Usage: # bundle exec fastlane finalize_hotfix_release @@ -247,7 +247,7 @@ ENV["validate_translations"]="lintVanillaRelease" # bundle exec fastlane build_and_upload_release # bundle exec fastlane build_and_upload_release skip_confirm:true # bundle exec fastlane build_and_upload_release skip_prechecks:true - # bundle exec fastlane build_and_upload_release create_release:true + # bundle exec fastlane build_and_upload_release create_release:true ##################################################################################### desc "Builds and updates for distribution" lane :build_and_upload_release do | options | @@ -279,7 +279,7 @@ ENV["validate_translations"]="lintVanillaRelease" # Example: # bundle exec fastlane build_and_upload_pre_releases # bundle exec fastlane build_and_upload_pre_releases skip_confirm:true - # bundle exec fastlane build_and_upload_beta create_release:true + # bundle exec fastlane build_and_upload_beta create_release:true ##################################################################################### desc "Builds and updates for distribution" lane :build_and_upload_pre_releases do | options | @@ -546,12 +546,12 @@ ENV["validate_translations"]="lintVanillaRelease" Dir.chdir("..") do sh("mkdir -p #{build_dir}") unless is_ci - # We pre-build the Gutenberg RN bundle on a different job on CI, - # so cleaning here breaks the build + # We pre-build the Gutenberg RN bundle on a different job on CI, + # so cleaning here breaks the build UI.message("Cleaning branch...") sh("echo \"Cleaning branch\" >> #{logfile_path}") sh("./gradlew clean >> #{logfile_path} 2>&1") - end + end sh("mkdir -p #{build_dir}") UI.message("Running lint...") sh("echo \"Running lint...\" >> #{logfile_path}") @@ -616,7 +616,7 @@ ENV["validate_translations"]="lintVanillaRelease" lane :build_for_translation_review do | options | cmd_params = "" unless options[:custom_version].nil? - UI.message("Building custom version: #{options[:custom_version]}") + UI.message("Building custom version: #{options[:custom_version]}") cmd_params=" -PversionName=\"#{options[:custom_version]}\"" end @@ -626,7 +626,7 @@ ENV["validate_translations"]="lintVanillaRelease" android_merge_translators_strings(strings_folder:"./WordPress/src/main/res/") sh("export SUPPRESS_GUTENBERG_MOBILE_JS_BUNDLE_BUILD=1 && cd .. && ./gradlew --stacktrace assembleJalapenoRelease #{cmd_params}") - end + end ##################################################################################### # trigger_ci @@ -688,7 +688,7 @@ ENV["validate_translations"]="lintVanillaRelease" temp_dir = Dir.mktmpdir() command = "" - if is_ci + if is_ci command << "bundletool build-apks --bundle=\"#{bundle_path}\" \\ --output=\"#{temp_dir}/universal.apks\" \\ --mode=universal" @@ -717,8 +717,8 @@ ENV["validate_translations"]="lintVanillaRelease" # APKs built on CI are unsigned, so don't upload them until we have a fix release_assets = [aab_file_path] release_assets.append(apk_file_path) unless is_ci - create_release(repository:GHHELPER_REPO, - version: version["name"], + create_release(repository:GHHELPER_REPO, + version: version["name"], release_notes_file_path:release_notes_path, prerelease: set_prerelease_flag, release_assets: release_assets.join(',') @@ -727,7 +727,7 @@ ENV["validate_translations"]="lintVanillaRelease" private_lane :cleanup_release_files do | options | files = options[:files] - + files.each do | f | File.open(f, "w") {} sh("git add #{f}") @@ -746,7 +746,7 @@ ENV["validate_translations"]="lintVanillaRelease" def release_note_short_path project_root = File.dirname(File.expand_path(File.dirname(__FILE__))) File.join(project_root, "WordPress", "metadata/release_notes_short.txt") - end + end def universal_apk_name(version) "wpandroid-#{version["name"]}-universal.apk"