fastlane-plugin-wpmreleasetoolkit 11.1.0 → 12.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_xml_release_notes.rb +0 -2
  3. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb +1 -9
  4. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/close_milestone_action.rb +0 -2
  5. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/{create_release_action.rb → create_github_release_action.rb} +1 -3
  6. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb +0 -1
  7. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_backmerge_pull_request_action.rb +4 -1
  8. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/publish_github_release_action.rb +63 -0
  9. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_check_beta_deps.rb +0 -3
  10. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +2 -373
  11. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb +8 -29
  12. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +26 -1
  13. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb +0 -270
  14. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/release_note_short_metadata_block.rb +2 -2
  15. data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
  16. metadata +8 -58
  17. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +0 -137
  18. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +0 -108
  19. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb +0 -90
  20. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_final_release.rb +0 -82
  21. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +0 -91
  22. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb +0 -109
  23. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +0 -108
  24. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +0 -86
  25. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +0 -89
  26. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_alpha_version.rb +0 -62
  27. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_app_version.rb +0 -62
  28. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_release_version.rb +0 -62
  29. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_hotfix_prechecks.rb +0 -78
  30. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb +0 -70
  31. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb +0 -98
  32. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb +0 -74
  33. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb +0 -67
  34. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +0 -83
  35. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb +0 -87
  36. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb +0 -76
  37. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb +0 -65
  38. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_current_branch_is_hotfix.rb +0 -40
  39. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb +0 -66
  40. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_app_version.rb +0 -54
  41. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_number.rb +0 -54
  42. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb +0 -60
  43. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_hotfix_prechecks.rb +0 -78
  44. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_tag_build.rb +0 -44
  45. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_validate_ci_build.rb +0 -46
  46. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_git_helper.rb +0 -28
  47. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_git_helper.rb +0 -28
@@ -1,108 +0,0 @@
1
- module Fastlane
2
- module Actions
3
- class AndroidBuildPrechecksAction < Action
4
- def self.run(params)
5
- require_relative '../../helper/android/android_version_helper'
6
- require_relative '../../helper/git_helper'
7
-
8
- UI.user_error!("Can't build beta and final at the same time!") if params[:final] && params[:beta]
9
-
10
- # Verify that the current branch is a release branch. Notice that `ensure_git_branch` expects a RegEx parameter
11
- ensure_git_branch(branch: '^release/') unless other_action.is_ci
12
-
13
- build_gradle_path = params[:build_gradle_path]
14
- version_properties_path = params[:version_properties_path]
15
-
16
- message = ''
17
- unless !params[:beta] && !params[:final]
18
- beta_version = Fastlane::Helper::Android::VersionHelper.get_release_version(
19
- build_gradle_path: build_gradle_path,
20
- version_properties_path: version_properties_path
21
- )
22
- end
23
- if params[:alpha]
24
- alpha_version = Fastlane::Helper::Android::VersionHelper.get_alpha_version(
25
- build_gradle_path: build_gradle_path,
26
- version_properties_path: version_properties_path
27
- )
28
- end
29
-
30
- UI.user_error!("Can't build a final release out of this branch because it's configured as a beta release!") if params[:final] && Fastlane::Helper::Android::VersionHelper.is_beta_version?(beta_version)
31
-
32
- message << "Building version #{beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}) (for upload to Release Channel)\n" if params[:final]
33
- message << "Building version #{beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}) (for upload to Beta Channel)\n" if params[:beta]
34
- message << "Building version #{alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}) (for upload to Alpha Channel)\n" if params[:alpha]
35
-
36
- UI.important(message)
37
-
38
- if !options[:skip_confirm] && !UI.confirm('Do you want to continue?')
39
- UI.user_error!('Aborted by user request')
40
- end
41
-
42
- # Check local repo status
43
- other_action.ensure_git_status_clean unless other_action.is_ci
44
- end
45
-
46
- #####################################################
47
- # @!group Documentation
48
- #####################################################
49
-
50
- def self.description
51
- 'Runs some prechecks before the build'
52
- end
53
-
54
- def self.details
55
- 'Runs some prechecks before the build'
56
- end
57
-
58
- def self.available_options
59
- [
60
- FastlaneCore::ConfigItem.new(key: :skip_confirm,
61
- env_name: 'FL_ANDROID_BUILD_PRECHECKS_SKIP_CONFIRM',
62
- description: 'True to avoid the system ask for confirmation',
63
- type: Boolean,
64
- default_value: false),
65
- FastlaneCore::ConfigItem.new(key: :alpha,
66
- env_name: 'FL_ANDROID_BUILD_PRECHECKS_ALPHA_BUILD',
67
- description: 'True if this is for an alpha build',
68
- type: Boolean,
69
- default_value: false),
70
- FastlaneCore::ConfigItem.new(key: :beta,
71
- env_name: 'FL_ANDROID_BUILD_PRECHECKS_BETA_BUILD',
72
- description: 'True if this is for a beta build',
73
- type: Boolean,
74
- default_value: false),
75
- FastlaneCore::ConfigItem.new(key: :final,
76
- env_name: 'FL_ANDROID_BUILD_PRECHECKS_FINAL_BUILD',
77
- description: 'True if this is for a final build',
78
- type: Boolean,
79
- default_value: false),
80
- FastlaneCore::ConfigItem.new(key: :build_gradle_path,
81
- description: 'Path to the build.gradle file',
82
- type: String,
83
- optional: true,
84
- conflicting_options: [:version_properties_path]),
85
- FastlaneCore::ConfigItem.new(key: :version_properties_path,
86
- description: 'Path to the version.properties file',
87
- type: String,
88
- optional: true,
89
- conflicting_options: [:build_gradle_path]),
90
- ]
91
- end
92
-
93
- def self.output
94
- end
95
-
96
- def self.return_value
97
- end
98
-
99
- def self.authors
100
- ['Automattic']
101
- end
102
-
103
- def self.is_supported?(platform)
104
- platform == :android
105
- end
106
- end
107
- end
108
- end
@@ -1,90 +0,0 @@
1
- module Fastlane
2
- module Actions
3
- class AndroidBumpVersionBetaAction < Action
4
- def self.run(params)
5
- UI.message 'Bumping app release version...'
6
-
7
- require_relative '../../helper/android/android_git_helper'
8
- require_relative '../../helper/android/android_version_helper'
9
-
10
- # Verify that the current branch is a release branch. Notice that `ensure_git_branch` expects a RegEx parameter
11
- ensure_git_branch(branch: '^release/')
12
-
13
- build_gradle_path = params[:build_gradle_path]
14
- version_properties_path = params[:version_properties_path]
15
-
16
- current_version = Fastlane::Helper::Android::VersionHelper.get_release_version(
17
- build_gradle_path: build_gradle_path,
18
- version_properties_path: version_properties_path
19
- )
20
- current_version_alpha = Fastlane::Helper::Android::VersionHelper.get_alpha_version(
21
- build_gradle_path: build_gradle_path,
22
- version_properties_path: version_properties_path
23
- )
24
- new_version_beta = Fastlane::Helper::Android::VersionHelper.calc_next_beta_version(current_version, current_version_alpha)
25
- new_version_alpha = current_version_alpha.nil? ? nil : Fastlane::Helper::Android::VersionHelper.calc_next_alpha_version(new_version_beta, current_version_alpha)
26
-
27
- vname = Fastlane::Helper::Android::VersionHelper::VERSION_NAME
28
- vcode = Fastlane::Helper::Android::VersionHelper::VERSION_CODE
29
- UI.message("Current version: #{current_version[vname]}(#{current_version[vcode]})")
30
- UI.message("Current alpha version: #{current_version_alpha[vname]}(#{current_version_alpha[vcode]})") unless current_version_alpha.nil?
31
- UI.message("New beta version: #{new_version_beta[vname]}(#{new_version_beta[vcode]})")
32
- UI.message("New alpha version: #{new_version_alpha[vname]}(#{new_version_alpha[vcode]})") unless current_version_alpha.nil?
33
-
34
- UI.message 'Updating app version...'
35
- Fastlane::Helper::Android::VersionHelper.update_versions(
36
- new_version_beta,
37
- new_version_alpha,
38
- version_properties_path: version_properties_path
39
- )
40
- UI.message 'Done!'
41
-
42
- Fastlane::Helper::Android::GitHelper.commit_version_bump(
43
- build_gradle_path: build_gradle_path,
44
- version_properties_path: version_properties_path
45
- )
46
- end
47
-
48
- #####################################################
49
- # @!group Documentation
50
- #####################################################
51
-
52
- def self.description
53
- 'Bumps the version of the app for a new beta.'
54
- end
55
-
56
- def self.details
57
- 'Bumps the version of the app for a new beta.'
58
- end
59
-
60
- def self.available_options
61
- [
62
- FastlaneCore::ConfigItem.new(key: :build_gradle_path,
63
- description: 'Path to the build.gradle file',
64
- type: String,
65
- optional: true,
66
- conflicting_options: [:version_properties_path]),
67
- FastlaneCore::ConfigItem.new(key: :version_properties_path,
68
- description: 'Path to the version.properties file',
69
- type: String,
70
- optional: true,
71
- conflicting_options: [:build_gradle_path]),
72
- ]
73
- end
74
-
75
- def self.output
76
- end
77
-
78
- def self.return_value
79
- end
80
-
81
- def self.authors
82
- ['Automattic']
83
- end
84
-
85
- def self.is_supported?(platform)
86
- platform == :android
87
- end
88
- end
89
- end
90
- end
@@ -1,82 +0,0 @@
1
- module Fastlane
2
- module Actions
3
- class AndroidBumpVersionFinalReleaseAction < Action
4
- def self.run(params)
5
- UI.message 'Bumping app release version...'
6
-
7
- require_relative '../../helper/android/android_git_helper'
8
- require_relative '../../helper/android/android_version_helper'
9
-
10
- # Verify that the current branch is a release branch. Notice that `ensure_git_branch` expects a RegEx parameter
11
- ensure_git_branch(branch: '^release/')
12
-
13
- build_gradle_path = params[:build_gradle_path]
14
- version_properties_path = params[:version_properties_path]
15
-
16
- current_version = Fastlane::Helper::Android::VersionHelper.get_release_version(
17
- build_gradle_path: build_gradle_path,
18
- version_properties_path: version_properties_path
19
- )
20
- current_version_alpha = Fastlane::Helper::Android::VersionHelper.get_alpha_version(
21
- build_gradle_path: build_gradle_path,
22
- version_properties_path: version_properties_path
23
- )
24
- final_version = Fastlane::Helper::Android::VersionHelper.calc_final_release_version(current_version, current_version_alpha)
25
-
26
- vname = Fastlane::Helper::Android::VersionHelper::VERSION_NAME
27
- vcode = Fastlane::Helper::Android::VersionHelper::VERSION_CODE
28
- UI.message("Current version: #{current_version[vname]}(#{current_version[vcode]})")
29
- UI.message("Current alpha version: #{current_version_alpha[vname]}(#{current_version_alpha[vcode]})") unless current_version_alpha.nil?
30
- UI.message("New release version: #{final_version[vname]}(#{final_version[vcode]})")
31
-
32
- UI.message 'Updating app version...'
33
- Fastlane::Helper::Android::VersionHelper.update_versions(
34
- final_version,
35
- current_version_alpha,
36
- version_properties_path: version_properties_path
37
- )
38
- UI.message 'Done!'
39
-
40
- Fastlane::Helper::Android::GitHelper.commit_version_bump(
41
- build_gradle_path: build_gradle_path,
42
- version_properties_path: version_properties_path
43
- )
44
- end
45
-
46
- #####################################################
47
- # @!group Documentation
48
- #####################################################
49
-
50
- def self.description
51
- 'Bumps the version of the app for a new beta.'
52
- end
53
-
54
- def self.details
55
- 'Bumps the version of the app for a new beta.'
56
- end
57
-
58
- def self.available_options
59
- [
60
- FastlaneCore::ConfigItem.new(key: :build_gradle_path,
61
- description: 'Path to the build.gradle file',
62
- type: String,
63
- optional: true,
64
- conflicting_options: [:version_properties_path]),
65
- FastlaneCore::ConfigItem.new(key: :version_properties_path,
66
- description: 'Path to the version.properties file',
67
- type: String,
68
- optional: true,
69
- conflicting_options: [:build_gradle_path]),
70
- ]
71
- end
72
-
73
- def self.authors
74
- ['Automattic']
75
- end
76
-
77
- def self.is_supported?(platform)
78
- platform == :android
79
- end
80
- end
81
- end
82
- end
@@ -1,91 +0,0 @@
1
- module Fastlane
2
- module Actions
3
- class AndroidBumpVersionHotfixAction < Action
4
- def self.run(params)
5
- UI.message 'Bumping app release version for hotfix...'
6
-
7
- require_relative '../../helper/android/android_git_helper'
8
-
9
- build_gradle_path = params[:build_gradle_path]
10
- version_properties_path = params[:version_properties_path]
11
-
12
- Fastlane::Helper::GitHelper.create_branch("release/#{params[:version_name]}", from: params[:previous_version_name])
13
-
14
- current_version = Fastlane::Helper::Android::VersionHelper.get_release_version(
15
- build_gradle_path: build_gradle_path,
16
- version_properties_path: version_properties_path
17
- )
18
- new_version = Fastlane::Helper::Android::VersionHelper.calc_next_hotfix_version(params[:version_name], params[:version_code]) # NOTE: this just puts the name/code values in a tuple, unchanged (no actual calc/bumping)
19
- new_release_branch = "release/#{params[:version_name]}"
20
-
21
- name_key = Fastlane::Helper::Android::VersionHelper::VERSION_NAME
22
- code_key = Fastlane::Helper::Android::VersionHelper::VERSION_CODE
23
- UI.message("Current version: #{current_version[name_key]} (#{current_version[code_key]})")
24
- UI.message("New hotfix version: #{new_version[name_key]} (#{new_version[code_key]})")
25
- UI.message("Release branch: #{new_release_branch}")
26
-
27
- UI.message 'Updating app version...'
28
- Fastlane::Helper::Android::VersionHelper.update_versions(
29
- new_version,
30
- nil,
31
- version_properties_path: version_properties_path
32
- )
33
- UI.message 'Done!'
34
-
35
- Fastlane::Helper::Android::GitHelper.commit_version_bump(
36
- build_gradle_path: build_gradle_path,
37
- version_properties_path: version_properties_path
38
- )
39
-
40
- UI.message 'Done.'
41
- end
42
-
43
- #####################################################
44
- # @!group Documentation
45
- #####################################################
46
-
47
- def self.description
48
- 'Bumps the version of the app for a new beta.'
49
- end
50
-
51
- def self.details
52
- 'Bumps the version of the app for a new beta.'
53
- end
54
-
55
- def self.available_options
56
- [
57
- FastlaneCore::ConfigItem.new(key: :version_name,
58
- env_name: 'FL_ANDROID_BUMP_VERSION_HOTFIX_VERSION',
59
- description: 'The version name for the hotfix',
60
- type: String),
61
- FastlaneCore::ConfigItem.new(key: :version_code,
62
- env_name: 'FL_ANDROID_BUMP_VERSION_HOTFIX_CODE',
63
- description: 'The version code for the hotfix',
64
- type: Integer),
65
- FastlaneCore::ConfigItem.new(key: :previous_version_name,
66
- env_name: 'FL_ANDROID_BUMP_VERSION_HOTFIX_PREVIOUS_VERSION',
67
- description: 'The version to branch from',
68
- type: String),
69
- FastlaneCore::ConfigItem.new(key: :build_gradle_path,
70
- description: 'Path to the build.gradle file',
71
- type: String,
72
- optional: true,
73
- conflicting_options: [:version_properties_path]),
74
- FastlaneCore::ConfigItem.new(key: :version_properties_path,
75
- description: 'Path to the version.properties file',
76
- type: String,
77
- optional: true,
78
- conflicting_options: [:build_gradle_path]),
79
- ]
80
- end
81
-
82
- def self.authors
83
- ['Automattic']
84
- end
85
-
86
- def self.is_supported?(platform)
87
- platform == :android
88
- end
89
- end
90
- end
91
- end
@@ -1,109 +0,0 @@
1
- module Fastlane
2
- module Actions
3
- class AndroidBumpVersionReleaseAction < Action
4
- def self.run(params)
5
- # fastlane will take care of reading in the parameter and fetching the environment variable:
6
- UI.message 'Bumping app release version...'
7
-
8
- require_relative '../../helper/android/android_version_helper'
9
- require_relative '../../helper/android/android_git_helper'
10
-
11
- build_gradle_path = params[:build_gradle_path]
12
- version_properties_path = params[:version_properties_path]
13
-
14
- default_branch = params[:default_branch]
15
- other_action.ensure_git_branch(branch: default_branch)
16
-
17
- # Create new configuration
18
- new_short_version = Fastlane::Helper::Android::VersionHelper.bump_version_release(
19
- build_gradle_path: build_gradle_path,
20
- version_properties_path: version_properties_path
21
- )
22
-
23
- current_version = Fastlane::Helper::Android::VersionHelper.get_release_version(
24
- build_gradle_path: build_gradle_path,
25
- version_properties_path: version_properties_path
26
- )
27
- current_version_alpha = Fastlane::Helper::Android::VersionHelper.get_alpha_version(
28
- build_gradle_path: build_gradle_path,
29
- version_properties_path: version_properties_path
30
- )
31
- new_version_beta = Fastlane::Helper::Android::VersionHelper.calc_next_release_version(current_version, current_version_alpha)
32
- new_version_alpha = current_version_alpha.nil? ? nil : Fastlane::Helper::Android::VersionHelper.calc_next_alpha_version(new_version_beta, current_version_alpha)
33
- new_release_branch = "release/#{new_short_version}"
34
-
35
- vname = Fastlane::Helper::Android::VersionHelper::VERSION_NAME
36
- vcode = Fastlane::Helper::Android::VersionHelper::VERSION_CODE
37
- UI.message("Current version: #{current_version[vname]}(#{current_version[vcode]})")
38
- UI.message("Current alpha version: #{current_version_alpha[vname]}(#{current_version_alpha[vcode]})") unless current_version_alpha.nil?
39
- UI.message("New beta version: #{new_version_beta[vname]}(#{new_version_beta[vcode]})")
40
- UI.message("New alpha version: #{new_version_alpha[vname]}(#{new_version_alpha[vcode]})") unless current_version_alpha.nil?
41
- UI.message("New version: #{new_short_version}")
42
- UI.message("Release branch: #{new_release_branch}")
43
-
44
- # Update local default branch and create branch from it
45
- UI.message 'Creating new branch...'
46
- Fastlane::Helper::GitHelper.create_branch(new_release_branch, from: default_branch)
47
- UI.message 'Done!'
48
-
49
- UI.message 'Updating app version...'
50
- Fastlane::Helper::Android::VersionHelper.update_versions(
51
- new_version_beta,
52
- new_version_alpha,
53
- version_properties_path: version_properties_path
54
- )
55
- Fastlane::Helper::Android::GitHelper.commit_version_bump(
56
- build_gradle_path: build_gradle_path,
57
- version_properties_path: version_properties_path
58
- )
59
- UI.message 'Done.'
60
- end
61
-
62
- #####################################################
63
- # @!group Documentation
64
- #####################################################
65
-
66
- def self.description
67
- 'Bumps the version of the app for a new beta.'
68
- end
69
-
70
- def self.details
71
- 'Bumps the version of the app for a new beta.'
72
- end
73
-
74
- def self.available_options
75
- [
76
- FastlaneCore::ConfigItem.new(key: :default_branch,
77
- env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
78
- description: 'Default branch of the repository',
79
- type: String,
80
- default_value: Fastlane::Helper::GitHelper::DEFAULT_GIT_BRANCH),
81
- FastlaneCore::ConfigItem.new(key: :build_gradle_path,
82
- description: 'Path to the build.gradle file',
83
- type: String,
84
- optional: true,
85
- conflicting_options: [:version_properties_path]),
86
- FastlaneCore::ConfigItem.new(key: :version_properties_path,
87
- description: 'Path to the version.properties file',
88
- type: String,
89
- optional: true,
90
- conflicting_options: [:build_gradle_path]),
91
- ]
92
- end
93
-
94
- def self.output
95
- end
96
-
97
- def self.return_value
98
- end
99
-
100
- def self.authors
101
- ['Automattic']
102
- end
103
-
104
- def self.is_supported?(platform)
105
- platform == :android
106
- end
107
- end
108
- end
109
- end
@@ -1,108 +0,0 @@
1
- module Fastlane
2
- module Actions
3
- class AndroidCodefreezePrechecksAction < Action
4
- VERSION_RELEASE = 'release'.freeze
5
- VERSION_ALPHA = 'alpha'.freeze
6
-
7
- def self.run(params)
8
- # fastlane will take care of reading in the parameter and fetching the environment variable:
9
- UI.message "Skip confirm on code freeze: #{params[:skip_confirm]}"
10
-
11
- require_relative '../../helper/android/android_version_helper'
12
- require_relative '../../helper/android/android_git_helper'
13
-
14
- build_gradle_path = params[:build_gradle_path]
15
- version_properties_path = params[:version_properties_path]
16
-
17
- # Checkout default branch and update
18
- default_branch = params[:default_branch]
19
- Fastlane::Helper::GitHelper.checkout_and_pull(default_branch)
20
-
21
- # Create versions
22
- current_version = Fastlane::Helper::Android::VersionHelper.get_release_version(
23
- build_gradle_path: build_gradle_path,
24
- version_properties_path: version_properties_path
25
- )
26
- current_alpha_version = Fastlane::Helper::Android::VersionHelper.get_alpha_version(
27
- build_gradle_path: build_gradle_path,
28
- version_properties_path: version_properties_path
29
- )
30
- next_version = Fastlane::Helper::Android::VersionHelper.calc_next_release_version(current_version, current_alpha_version)
31
- next_alpha_version = current_alpha_version.nil? ? nil : Fastlane::Helper::Android::VersionHelper.calc_next_alpha_version(next_version, current_alpha_version)
32
-
33
- no_alpha_version_message = "No alpha version configured. If you wish to configure an alpha version please update version.properties to include an alpha key for this app\n"
34
- # Ask user confirmation
35
- unless params[:skip_confirm]
36
- confirm_message = "Building a new release branch starting from #{default_branch}.\nCurrent version is #{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
37
- confirm_message += current_alpha_version.nil? ? no_alpha_version_message : "Current Alpha version is #{current_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{current_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
38
- confirm_message += "After code freeze the new version will be: #{next_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{next_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
39
- confirm_message += current_alpha_version.nil? ? '' : "After code freeze the new Alpha will be: #{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
40
- confirm_message += 'Do you want to continue?'
41
- UI.user_error!('Aborted by user request') unless UI.confirm(confirm_message)
42
- end
43
-
44
- # Check local repo status
45
- other_action.ensure_git_status_clean
46
-
47
- # Return the current version
48
- Fastlane::Helper::Android::VersionHelper.get_public_version(
49
- build_gradle_path: build_gradle_path,
50
- version_properties_path: version_properties_path
51
- )
52
- end
53
-
54
- #####################################################
55
- # @!group Documentation
56
- #####################################################
57
-
58
- def self.description
59
- 'Runs some prechecks before code freeze'
60
- end
61
-
62
- def self.details
63
- 'Updates the default branch, checks the app version and ensure the branch is clean'
64
- end
65
-
66
- def self.available_options
67
- # Define all options your action supports.
68
- [
69
- FastlaneCore::ConfigItem.new(key: :skip_confirm,
70
- env_name: 'FL_ANDROID_CODEFREEZE_PRECHECKS_SKIPCONFIRM',
71
- description: 'Skips confirmation before code freeze',
72
- type: Boolean,
73
- default_value: false), # the default value if the user didn't provide one
74
- FastlaneCore::ConfigItem.new(key: :default_branch,
75
- env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
76
- description: 'Default branch of the repository',
77
- type: String,
78
- default_value: Fastlane::Helper::GitHelper::DEFAULT_GIT_BRANCH),
79
- FastlaneCore::ConfigItem.new(key: :build_gradle_path,
80
- description: 'Path to the build.gradle file',
81
- type: String,
82
- optional: true,
83
- conflicting_options: [:version_properties_path]),
84
- FastlaneCore::ConfigItem.new(key: :version_properties_path,
85
- description: 'Path to the version.properties file',
86
- type: String,
87
- optional: true,
88
- conflicting_options: [:build_gradle_path]),
89
- ]
90
- end
91
-
92
- def self.output
93
- end
94
-
95
- def self.return_value
96
- 'Version of the app before code freeze'
97
- end
98
-
99
- def self.authors
100
- ['Automattic']
101
- end
102
-
103
- def self.is_supported?(platform)
104
- platform == :android
105
- end
106
- end
107
- end
108
- end
@@ -1,86 +0,0 @@
1
- module Fastlane
2
- module Actions
3
- class AndroidCompletecodefreezePrechecksAction < Action
4
- def self.run(params)
5
- UI.message "Skip confirm: #{params[:skip_confirm]}"
6
-
7
- require_relative '../../helper/android/android_version_helper'
8
- require_relative '../../helper/android/android_git_helper'
9
- require_relative '../../helper/git_helper'
10
-
11
- current_branch = Fastlane::Helper::GitHelper.current_git_branch
12
- UI.user_error!("Current branch - '#{current_branch}' - is not a release branch. Abort.") unless current_branch.start_with?('release/')
13
-
14
- build_gradle_path = params[:build_gradle_path]
15
- version_properties_path = params[:version_properties_path]
16
-
17
- version = Fastlane::Helper::Android::VersionHelper.get_public_version(
18
- build_gradle_path: build_gradle_path,
19
- version_properties_path: version_properties_path
20
- )
21
- message = "Completing code freeze for: #{version}\n"
22
- if params[:skip_confirm]
23
- UI.message(message)
24
- else
25
- UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
26
- end
27
-
28
- # Check local repo status
29
- other_action.ensure_git_status_clean
30
-
31
- version
32
- end
33
-
34
- #####################################################
35
- # @!group Documentation
36
- #####################################################
37
-
38
- def self.description
39
- 'Runs some prechecks before finalizing a code freeze'
40
- end
41
-
42
- def self.details
43
- 'Runs some prechecks before finalizing a code freeze'
44
- end
45
-
46
- def self.available_options
47
- [
48
- FastlaneCore::ConfigItem.new(key: :skip_confirm,
49
- env_name: 'FL_ANDROID_COMPLETECODEFREEZE_PRECHECKS_SKIPCONFIRM',
50
- description: 'Skips confirmation',
51
- type: Boolean,
52
- default_value: false), # the default value if the user didn't provide one
53
- FastlaneCore::ConfigItem.new(key: :build_gradle_path,
54
- description: 'Path to the build.gradle file',
55
- type: String,
56
- optional: true,
57
- conflicting_options: [:version_properties_path]),
58
- FastlaneCore::ConfigItem.new(key: :version_properties_path,
59
- description: 'Path to the version.properties file',
60
- type: String,
61
- optional: true,
62
- conflicting_options: [:build_gradle_path]),
63
- ]
64
- end
65
-
66
- def self.output
67
- end
68
-
69
- def self.return_type
70
- :string
71
- end
72
-
73
- def self.return_value
74
- 'The version number that has been prechecked.'
75
- end
76
-
77
- def self.authors
78
- ['Automattic']
79
- end
80
-
81
- def self.is_supported?(platform)
82
- platform == :android
83
- end
84
- end
85
- end
86
- end