Class: Fastlane::Actions::IosBetabuildPrechecksAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::IosBetabuildPrechecksAction
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_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
88 89 90 91 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb', line 88 def self. # So no one will ever forget your contribution to fastlane :) You are awesome btw! ['Automattic'] end |
.available_options ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb', line 61 def self. [ FastlaneCore::ConfigItem.new(key: :base_version, env_name: 'FL_IOS_BETABUILD_PRECHECKS_BASE_VERSION', description: 'The version to work on', # a short description of this parameter is_string: true, optional: true), # true: verifies the input is a string, false: every kind of value), FastlaneCore::ConfigItem.new(key: :skip_confirm, env_name: 'FL_IOS_BETABUILD_PRECHECKS_SKIPCONFIRM', description: 'Skips confirmation', is_string: false, # true: verifies the input is a string, false: every kind of value 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), ] end |
.description ⇒ Object
53 54 55 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb', line 53 def self.description 'Runs some prechecks before preparing for a new test build' end |
.details ⇒ Object
57 58 59 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb', line 57 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
42 43 44 45 46 47 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb', line 42 def self.get_user_build_version(version, ) UI.user_error!("Release branch for version #{version} doesn't exist. Abort.") unless Fastlane::Helper::GitHelper.checkout_and_pull(release: version) build_version = Fastlane::Helper::Ios::VersionHelper.get_build_version << "Looking at branch release/#{version} as requested by user. Detected version: #{build_version}.\n" build_version end |
.is_supported?(platform) ⇒ Boolean
93 94 95 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb', line 93 def self.is_supported?(platform) [:ios, :mac].include?(platform) end |
.output ⇒ Object
81 82 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb', line 81 def self.output end |
.return_value ⇒ Object
84 85 86 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb', line 84 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 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_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/ios/ios_version_helper' require_relative '../../helper/ios/ios_git_helper' # Checkout default branch and update default_branch = params[:default_branch] Fastlane::Helper::GitHelper.checkout_and_pull(default_branch) # Check versions build_version = Fastlane::Helper::Ios::VersionHelper.get_build_version = "The following current version has been detected: #{build_version}\n" # Check branch app_version = Fastlane::Helper::Ios::VersionHelper.get_public_version 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 build_version = get_user_build_version(params[:base_version], ) unless params[:base_version].nil? next_version = Fastlane::Helper::Ios::VersionHelper.calc_next_build_version(build_version) # Verify << "Updating branch to version: #{next_version}.\n" 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 build_version end |