Class: Fastlane::Actions::AndroidFinalizePrechecksAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



62
63
64
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb', line 62

def self.authors
  ['Automattic']
end

.available_optionsObject



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb', line 42

def self.available_options
  # Define all options your action supports.

  # Below a few examples
  [
    FastlaneCore::ConfigItem.new(key: :skip_confirm,
                                 env_name: 'FL_ANDROID_FINALIZE_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
  ]
end

.descriptionObject



34
35
36
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb', line 34

def self.description
  'Runs some prechecks before finalizing a release'
end

.detailsObject



38
39
40
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb', line 38

def self.details
  'Runs some prechecks before finalizing a release'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb', line 66

def self.is_supported?(platform)
  platform == :android
end

.outputObject



55
56
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb', line 55

def self.output
end

.return_valueObject



58
59
60
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb', line 58

def self.return_value
  'The current app version'
end

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb', line 8

def self.run(params)
  UI.message "Skip confirm: #{params[:skip_confirm]}"

  require_relative '../../helper/android/android_version_helper'
  require_relative '../../helper/android/android_git_helper'

  UI.user_error!('This is not a release branch. Abort.') unless other_action.git_branch.start_with?('release/')

  version = Fastlane::Helper::Android::VersionHelper.get_public_version
  message = "Finalizing release: #{version}\n"
  if params[:skip_confirm]
    UI.message(message)
  else
    UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
  end

  # Check local repo status
  other_action.ensure_git_status_clean()

  version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]
end