Class: Fastlane::Actions::IosBumpVersionBetaAction

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

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



43
44
45
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb', line 43

def self.authors
  ['Automattic']
end

.available_optionsObject



34
35
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb', line 34

def self.available_options
end

.create_configObject



51
52
53
54
55
56
57
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb', line 51

def self.create_config
  @current_version = Fastlane::Helper::Ios::VersionHelper.get_build_version
  @current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version unless ENV['INTERNAL_CONFIG_FILE'].nil?
  @new_internal_version = Fastlane::Helper::Ios::VersionHelper.create_internal_version(@current_version) unless ENV['INTERNAL_CONFIG_FILE'].nil?
  @new_beta_version = Fastlane::Helper::Ios::VersionHelper.calc_next_build_version(@current_version)
  @short_version = Fastlane::Helper::Ios::VersionHelper.get_short_version_string(@new_beta_version)
end

.descriptionObject



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

def self.description
  'Bumps the version of the app for a new beta'
end

.detailsObject



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

def self.details
  'Bumps the version of the app for a new beta'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb', line 47

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

.outputObject



37
38
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb', line 37

def self.output
end

.return_valueObject



40
41
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb', line 40

def self.return_value
end

.run(params) ⇒ Object



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

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

  require_relative '../../helper/ios/ios_git_helper'
  require_relative '../../helper/ios/ios_version_helper'

  # Verify that the current branch is a release branch. Notice that `ensure_git_branch` expects a RegEx parameter
  ensure_git_branch(branch: '^release/')
  create_config
  show_config

  UI.message 'Updating XcConfig...'
  Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_beta_version, @short_version, @new_internal_version)
  UI.message 'Done!'

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

.show_configObject



59
60
61
62
63
64
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb', line 59

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 beta version: #{@new_beta_version}")
  UI.message("New internal version: #{@new_internal_version}") unless ENV['INTERNAL_CONFIG_FILE'].nil?
end