Class: Fastlane::Actions::AndroidBetabuildPrechecksAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::AndroidBetabuildPrechecksAction
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .return_value ⇒ Object
Class Method Summary collapse
Class Method Details
.authors ⇒ Object
127 128 129 130 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb', line 127 def self. # So no one will ever forget your contribution to fastlane :) You are awesome btw! ['Automattic'] end |
.available_options ⇒ Object
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb', line 90 def self. [ FastlaneCore::ConfigItem.new(key: :base_version, env_name: 'FL_ANDROID_BETABUILD_PRECHECKS_BASE_VERSION', description: 'The version to work on', # a short description of this parameter type: String, optional: true), # true: verifies the input is a string, false: every kind of value), FastlaneCore::ConfigItem.new(key: :skip_confirm, env_name: 'FL_ANDROID_BETABUILD_PRECHECKS_SKIPCONFIRM', description: 'Skips confirmation', type: Boolean, default_value: false), # the default value if the user didn't provide one FastlaneCore::ConfigItem.new(key: :default_branch, env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH', description: 'Default branch of the repository', type: String, default_value: Fastlane::Helper::GitHelper::DEFAULT_GIT_BRANCH), FastlaneCore::ConfigItem.new(key: :build_gradle_path, description: 'Path to the build.gradle file', type: String, optional: true, conflicting_options: [:version_properties_path]), FastlaneCore::ConfigItem.new(key: :version_properties_path, description: 'Path to the version.properties file', type: String, optional: true, conflicting_options: [:build_gradle_path]), ] end |
.description ⇒ Object
82 83 84 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb', line 82 def self.description 'Runs some prechecks before preparing for a new test build' end |
.details ⇒ Object
86 87 88 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb', line 86 def self.details 'Updates the relevant release branch, checks the app version and ensure the branch is clean' end |
.get_user_build_version(version:, message:) ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb', line 63 def self.get_user_build_version(version:, message:) UI.user_error!("Release branch for version #{version} doesn't exist. Abort.") unless Fastlane::Helper::GitHelper.checkout_and_pull(release: version) release_version = Fastlane::Helper::Android::VersionHelper.get_release_version( build_gradle_path: build_gradle_path, version_properties_path: version_properties_path ) << "Looking at branch release/#{version} as requested by user. Detected version: #{release_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}.\n" alpha_release_version = Fastlane::Helper::Android::VersionHelper.get_alpha_version( build_gradle_path: build_gradle_path, version_properties_path: version_properties_path ) << "and Alpha Version: #{alpha_release_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}\n" unless alpha_release_version.nil? [release_version, alpha_release_version] end |
.is_supported?(platform) ⇒ Boolean
132 133 134 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb', line 132 def self.is_supported?(platform) platform == :android end |
.output ⇒ Object
120 121 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb', line 120 def self.output end |
.return_value ⇒ Object
123 124 125 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb', line 123 def self.return_value # If you method provides a return value, you can describe here what it does end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb', line 4 def self.run(params) UI. "Skip confirm: #{params[:skip_confirm]}" UI. "Work on version: #{params[:base_version]}" unless params[:base_version].nil? require_relative '../../helper/android/android_version_helper' require_relative '../../helper/android/android_git_helper' build_gradle_path = params[:build_gradle_path] version_properties_path = params[:version_properties_path] # Checkout default branch and update default_branch = params[:default_branch] Fastlane::Helper::GitHelper.checkout_and_pull(default_branch) # Check versions release_version = Fastlane::Helper::Android::VersionHelper.get_release_version( build_gradle_path: build_gradle_path, version_properties_path: version_properties_path ) = "The following current version has been detected: #{release_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}\n" alpha_release_version = Fastlane::Helper::Android::VersionHelper.get_alpha_version( build_gradle_path: build_gradle_path, version_properties_path: version_properties_path ) << "The following Alpha version has been detected: #{alpha_release_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}\n" unless alpha_release_version.nil? # Check branch app_version = Fastlane::Helper::Android::VersionHelper.get_public_version( build_gradle_path: build_gradle_path, version_properties_path: version_properties_path ) UI.user_error!("#{}Release branch for version #{app_version} doesn't exist. Abort.") unless !params[:base_version].nil? || Fastlane::Helper::GitHelper.checkout_and_pull(release: app_version) # Check user overwrite unless params[:base_version].nil? overwrite_version = get_user_build_version(version: params[:base_version], message: ) release_version = overwrite_version[0] alpha_release_version = overwrite_version[1] end next_beta_version = Fastlane::Helper::Android::VersionHelper.calc_next_beta_version(release_version, alpha_release_version) next_alpha_version = Fastlane::Helper::Android::VersionHelper.calc_next_alpha_version(next_beta_version, alpha_release_version) unless alpha_release_version.nil? # Verify << "Updating branch to version: #{next_beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{next_beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}) " << "and #{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n" unless alpha_release_version.nil? if params[:skip_confirm] UI.() else UI.user_error!('Aborted by user request') unless UI.confirm("#{}Do you want to continue?") end # Check local repo status other_action.ensure_git_status_clean # Return the current version [next_beta_version, next_alpha_version] end |