Class: Fastlane::Actions::IosCodefreezePrechecksAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::IosCodefreezePrechecksAction
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_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
67 68 69 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb', line 67 def self. ['Automattic'] end |
.available_options ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb', line 44 def self. # Define all options your action supports. [ FastlaneCore::ConfigItem.new(key: :skip_confirm, env_name: 'FL_IOS_CODEFREEZE_PRECHECKS_SKIPCONFIRM', description: 'Skips confirmation before code freeze', 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), ] end |
.description ⇒ Object
36 37 38 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb', line 36 def self.description 'Runs some prechecks before code freeze' end |
.details ⇒ Object
40 41 42 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb', line 40 def self.details 'Updates the default branch, checks the app version and ensure the branch is clean' end |
.is_supported?(platform) ⇒ Boolean
71 72 73 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb', line 71 def self.is_supported?(platform) %i[ios mac].include?(platform) end |
.output ⇒ Object
60 61 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb', line 60 def self.output end |
.return_value ⇒ Object
63 64 65 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb', line 63 def self.return_value 'Version of the app before code freeze' 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 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb', line 4 def self.run(params) # fastlane will take care of reading in the parameter and fetching the environment variable: UI. "Skip confirm on code freeze: #{params[:skip_confirm]}" 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) # Create versions current_version = Fastlane::Helper::Ios::VersionHelper.get_public_version current_build_version = Fastlane::Helper::Ios::VersionHelper.get_build_version next_version = Fastlane::Helper::Ios::VersionHelper.calc_next_release_version(current_version) # Ask user confirmation unless params[:skip_confirm] || UI.confirm("Building a new release branch starting from #{default_branch}.\nCurrent version is #{current_version} (#{current_build_version}).\nAfter code freeze the new version will be: #{next_version}.\nDo you want to continue?") UI.user_error!('Aborted by user request') end # Check local repo status other_action.ensure_git_status_clean # Return the current version current_version end |