Class: Fastlane::Actions::AndroidBumpVersionReleaseAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::AndroidBumpVersionReleaseAction
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.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
108 109 110 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb', line 108 def self. ['Automattic'] end |
.available_options ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb', line 76 def self. [ 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), FastlaneCore::ConfigItem.new(key: :build_gradle_path, description: 'Path to the build.gradle file', type: String, optional: true, conflicting_options: %i[project_name project_root_folder version_properties_path]), FastlaneCore::ConfigItem.new(key: :version_properties_path, description: 'Path to the version.properties file', type: String, optional: true, conflicting_options: %i[build_gradle_path project_name project_root_folder]), Fastlane::Helper::Deprecated.project_root_folder_config_item, Fastlane::Helper::Deprecated.project_name_config_item, ] end |
.description ⇒ Object
68 69 70 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb', line 68 def self.description 'Bumps the version of the app for a new beta.' end |
.details ⇒ Object
72 73 74 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb', line 72 def self.details 'Bumps the version of the app for a new beta.' end |
.is_supported?(platform) ⇒ Boolean
112 113 114 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb', line 112 def self.is_supported?(platform) platform == :android end |
.output ⇒ Object
102 103 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb', line 102 def self.output end |
.return_value ⇒ Object
105 106 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb', line 105 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 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb', line 4 def self.run(params) # fastlane will take care of reading in the parameter and fetching the environment variable: UI. 'Bumping app release version...' require_relative '../../helper/android/android_version_helper' require_relative '../../helper/android/android_git_helper' project_root_folder = params[:project_root_folder] project_name = params[:project_name] build_gradle_path = params[:build_gradle_path] || (File.join(project_root_folder || '.', project_name, 'build.gradle') unless project_name.nil?) version_properties_path = params[:version_properties_path] || File.join(project_root_folder || '.', 'version.properties') default_branch = params[:default_branch] other_action.ensure_git_branch(branch: default_branch) # Create new configuration new_short_version = Fastlane::Helper::Android::VersionHelper.bump_version_release( build_gradle_path: build_gradle_path, version_properties_path: version_properties_path ) current_version = Fastlane::Helper::Android::VersionHelper.get_release_version( build_gradle_path: build_gradle_path, version_properties_path: version_properties_path ) current_version_alpha = Fastlane::Helper::Android::VersionHelper.get_alpha_version( build_gradle_path: build_gradle_path, version_properties_path: version_properties_path ) new_version_beta = Fastlane::Helper::Android::VersionHelper.calc_next_release_version(current_version, current_version_alpha) new_version_alpha = current_version_alpha.nil? ? nil : Fastlane::Helper::Android::VersionHelper.calc_next_alpha_version(new_version_beta, current_version_alpha) new_release_branch = "release/#{new_short_version}" vname = Fastlane::Helper::Android::VersionHelper::VERSION_NAME vcode = Fastlane::Helper::Android::VersionHelper::VERSION_CODE UI.("Current version: #{current_version[vname]}(#{current_version[vcode]})") UI.("Current alpha version: #{current_version_alpha[vname]}(#{current_version_alpha[vcode]})") unless current_version_alpha.nil? UI.("New beta version: #{new_version_beta[vname]}(#{new_version_beta[vcode]})") UI.("New alpha version: #{new_version_alpha[vname]}(#{new_version_alpha[vcode]})") unless current_version_alpha.nil? UI.("New version: #{new_short_version}") UI.("Release branch: #{new_release_branch}") # Update local default branch and create branch from it UI. 'Creating new branch...' Fastlane::Helper::GitHelper.create_branch(new_release_branch, from: default_branch) UI. 'Done!' UI. 'Updating app version...' Fastlane::Helper::Android::VersionHelper.update_versions( new_version_beta, new_version_alpha, version_properties_path: version_properties_path ) Fastlane::Helper::Android::GitHelper.commit_version_bump( build_gradle_path: build_gradle_path, version_properties_path: version_properties_path ) UI. 'Done.' end |