Class: Fastlane::Actions::IosBumpVersionHotfixAction

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

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



56
57
58
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb', line 56

def self.authors
  ['Automattic']
end

.available_optionsObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb', line 33

def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :version,
      env_name: 'FL_IOS_BUMP_VERSION_HOTFIX_VERSION',
      description: 'The version of the hotfix',
      type: String
    ),
    FastlaneCore::ConfigItem.new(
      key: :previous_version,
      env_name: 'FL_IOS_BUMP_VERSION_HOTFIX_PREVIOUS_VERSION',
      description: 'The version to branch from',
      type: String
    ),
  ]
end

.create_config(previous_version, new_short_version) ⇒ Object



64
65
66
67
68
69
70
71
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb', line 64

def self.create_config(previous_version, new_short_version)
  @current_version = previous_version
  @current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version unless ENV['INTERNAL_CONFIG_FILE'].nil?
  @new_version = "#{new_short_version}.0"
  @new_version_internal = Fastlane::Helper::Ios::VersionHelper.create_internal_version(@new_version) unless ENV['INTERNAL_CONFIG_FILE'].nil?
  @new_short_version = new_short_version
  @new_release_branch = "release/#{@new_short_version}"
end

.descriptionObject



25
26
27
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb', line 25

def self.description
  'Bumps the version of the app and creates the new release branch'
end

.detailsObject



29
30
31
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb', line 29

def self.details
  'Bumps the version of the app and creates the new release branch'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb', line 60

def self.is_supported?(platform)
  %i[ios mac].include?(platform)
end

.outputObject



50
51
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb', line 50

def self.output
end

.return_valueObject



53
54
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb', line 53

def self.return_value
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb', line 4

def self.run(params)
  UI.message 'Bumping app release version for hotfix...'

  require_relative '../../helper/ios/ios_git_helper'
  Fastlane::Helper::GitHelper.create_branch("release/#{params[:version]}", from: params[:previous_version])
  create_config(params[:previous_version], params[:version])
  show_config

  UI.message 'Updating XcConfig...'
  Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_version, @new_short_version, @new_version_internal)
  UI.message 'Done!'

  Fastlane::Helper::Ios::GitHelper.commit_version_bump

  UI.message 'Done.'
end

.show_configObject



73
74
75
76
77
78
79
80
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb', line 73

def self.show_config
  UI.message("Current build version: #{@current_version}")
  UI.message("Current internal version: #{@current_version_internal}") unless ENV['INTERNAL_CONFIG_FILE'].nil?
  UI.message("New build version: #{@new_version}")
  UI.message("New internal version: #{@new_version_internal}") unless ENV['INTERNAL_CONFIG_FILE'].nil?
  UI.message("New short version: #{@new_short_version}")
  UI.message("Release branch: #{@new_release_branch}")
end