fastlane-plugin-wpmreleasetoolkit 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/ext/drawText/extconf.rb +1 -1
  3. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb +3 -3
  4. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +5 -5
  5. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +4 -4
  6. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb +2 -2
  7. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_final_release.rb +2 -2
  8. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +1 -1
  9. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb +2 -2
  10. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +2 -2
  11. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +2 -2
  12. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_xml_release_notes.rb +2 -2
  13. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb +1 -1
  14. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_file_by_version.rb +1 -1
  15. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb +2 -2
  16. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +5 -5
  17. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_alpha_version.rb +1 -1
  18. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_app_version.rb +1 -1
  19. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_release_version.rb +1 -1
  20. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_hotifx_prechecks.rb +5 -5
  21. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_merge_translators_strings.rb +1 -1
  22. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb +2 -2
  23. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_metadata.rb +1 -1
  24. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb +3 -3
  25. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_for_toolkit_updates_action.rb +99 -0
  26. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/circleci_trigger_job_action.rb +1 -1
  27. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb +1 -1
  28. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb +6 -5
  29. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb +2 -2
  30. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/removebranchprotection_action.rb +3 -3
  31. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setbranchprotection_action.rb +3 -3
  32. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setfrozentag_action.rb +1 -1
  33. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb +5 -5
  34. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb +4 -4
  35. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb +2 -2
  36. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +1 -1
  37. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb +5 -5
  38. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_check_beta_deps.rb +2 -2
  39. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_clear_intermediate_tags.rb +1 -1
  40. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb +4 -4
  41. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb +5 -5
  42. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_current_branch_is_hotfix.rb +1 -1
  43. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb +2 -2
  44. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb +5 -5
  45. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_app_version.rb +1 -1
  46. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb +1 -1
  47. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb +1 -1
  48. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_hotifx_prechecks.rb +5 -5
  49. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb +1 -1
  50. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_localize_project.rb +1 -1
  51. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_merge_translators_strings.rb +4 -4
  52. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_tag_build.rb +2 -2
  53. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata.rb +1 -1
  54. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb +3 -3
  55. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_validate_ci_build.rb +2 -2
  56. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/an_metadata_update_helper.rb +3 -3
  57. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb +11 -2
  58. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +9 -9
  59. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ci_helper.rb +1 -1
  60. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/configure_helper.rb +2 -2
  61. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/encryption_helper.rb +1 -1
  62. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +4 -6
  63. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_adc_app_sizes_helper.rb +3 -3
  64. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_helper.rb +3 -4
  65. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_update_helper.rb +1 -1
  66. data/lib/fastlane/plugin/wpmreleasetoolkit/models/configuration.rb +2 -2
  67. data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
  68. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22d749d3edd201c7a544486c77eee999cf5c2f4eb6232d575d3dbe7c2bca9371
4
- data.tar.gz: 93bfa99fe6595eca9a27a0b900c2fe0bbd9ecaf4c116fd9de8acf8a02c7498fa
3
+ metadata.gz: 0ea5db89dea2eb4b4879985bc5ee3d716ee8863f340ccc5fc285e34433353c51
4
+ data.tar.gz: 5aa0d8e024ef9fc4efb28f455be892be78a5fd8ae58fb7b99c60c5f941a8f51f
5
5
  SHA512:
6
- metadata.gz: c73d585587a42656b6a0f39e60573a38bc73464c15ef20ddc02650e6fb0dca830277f92962ac2d97544ab59ecda388d1a2b31265e17976d846a0c251dbb7e720
7
- data.tar.gz: 5a2afb8d0d5f8a835124ebf937be6e67f34686b7e44931e7d843b989c0daf2f69cb782bb530b2adaa23cff8952c5204687217ef4a46e21ae8bf48965963a959e
6
+ metadata.gz: fb23526af1cee62f484c4629ea986f111ba7c0f0fa64c2a649fc9aa358fb0f5e20f07de899c8da82bea9c7dfed0fa101e2437bb6cb3354cfda0ed38ff4568d84
7
+ data.tar.gz: e586e3f278be182ea75ce5023e27e2bef958a434d24228280bb8a3a29729e0a49499a26e282592d2ce136019bd02446c5c3b12501fb6b74a01f23fcc8eb983f9
@@ -33,4 +33,4 @@ FileUtils.cp(compiledPath, destinationPath)
33
33
 
34
34
  # Delete and overwrite the bundle file
35
35
  FileUtils.rm_rf(File.join(libDirectory, 'drawText.bundle'))
36
- FileUtils.touch(File.join(compilationDirectory, 'drawText.' + RbConfig::CONFIG['DLEXT']))
36
+ FileUtils.touch(File.join(compilationDirectory, "drawText.#{RbConfig::CONFIG['DLEXT']}"))
@@ -1,5 +1,5 @@
1
1
  require 'fastlane/action'
2
- require_relative '../../helper/an_metadata_update_helper.rb'
2
+ require_relative '../../helper/an_metadata_update_helper'
3
3
 
4
4
  module Fastlane
5
5
  module Actions
@@ -23,7 +23,7 @@ module Fastlane
23
23
  # Verifies that all the source files are available
24
24
  # to this action
25
25
  def self.check_source_files(source_files)
26
- source_files.values.each do |file_path|
26
+ source_files.each_value do |file_path|
27
27
  UI.user_error!("Couldn't find file at path '#{file_path}'") unless File.exist?(file_path)
28
28
  end
29
29
  end
@@ -92,7 +92,7 @@ module Fastlane
92
92
  # Manages tags depending on the type
93
93
  def self.write_target_block(fw, line)
94
94
  if is_block_id(line)
95
- key = line.split(' ')[1].tr('\"', '')
95
+ key = line.split[1].tr('\"', '')
96
96
  @blocks.each do |block|
97
97
  @current_block = block if block.is_handler_for(key)
98
98
  end
@@ -5,8 +5,8 @@ module Fastlane
5
5
  UI.message "Skip confirm: #{params[:skip_confirm]}"
6
6
  UI.message "Work on version: #{params[:base_version]}" unless params[:base_version].nil?
7
7
 
8
- require_relative '../../helper/android/android_version_helper.rb'
9
- require_relative '../../helper/android/android_git_helper.rb'
8
+ require_relative '../../helper/android/android_version_helper'
9
+ require_relative '../../helper/android/android_git_helper'
10
10
 
11
11
  # Checkout develop and update
12
12
  Fastlane::Helper::GitHelper.checkout_and_pull('develop')
@@ -34,10 +34,10 @@ module Fastlane
34
34
  # Verify
35
35
  message << "Updating branch to version: #{next_beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{next_beta_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}) "
36
36
  message << "and #{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n" unless alpha_release_version.nil?
37
- if !params[:skip_confirm]
38
- UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
39
- else
37
+ if params[:skip_confirm]
40
38
  UI.message(message)
39
+ else
40
+ UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
41
41
  end
42
42
 
43
43
  # Check local repo status
@@ -2,7 +2,7 @@ module Fastlane
2
2
  module Actions
3
3
  class AndroidBuildPrechecksAction < Action
4
4
  def self.run(params)
5
- require_relative '../../helper/android/android_version_helper.rb'
5
+ require_relative '../../helper/android/android_version_helper'
6
6
 
7
7
  UI.user_error!("Can't build beta and final at the same time!") if params[:final] && params[:beta]
8
8
 
@@ -18,10 +18,10 @@ module Fastlane
18
18
  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]
19
19
  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]
20
20
 
21
- if !params[:skip_confirm]
22
- UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
23
- else
21
+ if params[:skip_confirm]
24
22
  UI.message(message)
23
+ else
24
+ UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
25
25
  end
26
26
 
27
27
  # Check local repo status
@@ -4,8 +4,8 @@ module Fastlane
4
4
  def self.run(params)
5
5
  UI.message 'Bumping app release version...'
6
6
 
7
- require_relative '../../helper/android/android_git_helper.rb'
8
- require_relative '../../helper/android/android_version_helper.rb'
7
+ require_relative '../../helper/android/android_git_helper'
8
+ require_relative '../../helper/android/android_version_helper'
9
9
 
10
10
  Fastlane::Helper::GitHelper.ensure_on_branch!('release')
11
11
  create_config()
@@ -4,8 +4,8 @@ module Fastlane
4
4
  def self.run(params)
5
5
  UI.message 'Bumping app release version...'
6
6
 
7
- require_relative '../../helper/android/android_git_helper.rb'
8
- require_relative '../../helper/android/android_version_helper.rb'
7
+ require_relative '../../helper/android/android_git_helper'
8
+ require_relative '../../helper/android/android_version_helper'
9
9
 
10
10
  Fastlane::Helper::GitHelper.ensure_on_branch!('release')
11
11
  create_config()
@@ -4,7 +4,7 @@ module Fastlane
4
4
  def self.run(params)
5
5
  UI.message 'Bumping app release version for hotfix...'
6
6
 
7
- require_relative '../../helper/android/android_git_helper.rb'
7
+ require_relative '../../helper/android/android_git_helper'
8
8
  Fastlane::Helper::GitHelper.create_branch("release/#{params[:version_name]}", from: params[:previous_version_name])
9
9
  create_config(params[:previous_version_name], params[:version_name], params[:version_code])
10
10
  show_config()
@@ -5,8 +5,8 @@ module Fastlane
5
5
  # fastlane will take care of reading in the parameter and fetching the environment variable:
6
6
  UI.message 'Bumping app release version...'
7
7
 
8
- require_relative '../../helper/android/android_version_helper.rb'
9
- require_relative '../../helper/android/android_git_helper.rb'
8
+ require_relative '../../helper/android/android_version_helper'
9
+ require_relative '../../helper/android/android_git_helper'
10
10
 
11
11
  other_action.ensure_git_branch(branch: 'develop')
12
12
 
@@ -8,8 +8,8 @@ module Fastlane
8
8
  # fastlane will take care of reading in the parameter and fetching the environment variable:
9
9
  UI.message "Skip confirm on code freeze: #{params[:skip_confirm]}"
10
10
 
11
- require_relative '../../helper/android/android_version_helper.rb'
12
- require_relative '../../helper/android/android_git_helper.rb'
11
+ require_relative '../../helper/android/android_version_helper'
12
+ require_relative '../../helper/android/android_git_helper'
13
13
 
14
14
  # Checkout develop and update
15
15
  Fastlane::Helper::GitHelper.checkout_and_pull('develop')
@@ -4,8 +4,8 @@ module Fastlane
4
4
  def self.run(params)
5
5
  UI.message "Skip confirm: #{params[:skip_confirm]}"
6
6
 
7
- require_relative '../../helper/android/android_version_helper.rb'
8
- require_relative '../../helper/android/android_git_helper.rb'
7
+ require_relative '../../helper/android/android_version_helper'
8
+ require_relative '../../helper/android/android_git_helper'
9
9
 
10
10
  UI.user_error!('This is not a release branch. Abort.') unless other_action.git_branch.start_with?('release/')
11
11
 
@@ -2,9 +2,9 @@ module Fastlane
2
2
  module Actions
3
3
  class AndroidCreateXmlReleaseNotesAction < Action
4
4
  def self.run(params)
5
- require_relative '../../helper/android/android_git_helper.rb'
5
+ require_relative '../../helper/android/android_git_helper'
6
6
 
7
- release_notes_path = params[:download_path] + '/release_notes.xml'
7
+ release_notes_path = "#{params[:download_path]}/release_notes.xml"
8
8
  open(release_notes_path, 'w') do |f|
9
9
  params[:locales].each do |loc|
10
10
  puts "Looking for language: #{loc[1]}"
@@ -6,7 +6,7 @@ module Fastlane
6
6
 
7
7
  class AndroidCurrentBranchIsHotfixAction < Action
8
8
  def self.run(params)
9
- require_relative '../../helper/android/android_version_helper.rb'
9
+ require_relative '../../helper/android/android_version_helper'
10
10
  Fastlane::Helper::Android::VersionHelper.is_hotfix?(Fastlane::Helper::Android::VersionHelper.get_release_version)
11
11
  end
12
12
 
@@ -2,7 +2,7 @@ module Fastlane
2
2
  module Actions
3
3
  class AndroidDownloadFileByVersionAction < Action
4
4
  def self.run(params)
5
- require_relative '../../helper/android/android_localize_helper.rb'
5
+ require_relative '../../helper/android/android_localize_helper'
6
6
  require_relative '../../helper/github_helper'
7
7
 
8
8
  version = Fastlane::Helper::Android::VersionHelper.get_library_version_from_gradle_config(import_key: params[:import_key])
@@ -4,8 +4,8 @@ module Fastlane
4
4
  module Actions
5
5
  class AndroidDownloadTranslationsAction < Action
6
6
  def self.run(params)
7
- require_relative '../../helper/android/android_localize_helper.rb'
8
- require_relative '../../helper/git_helper.rb'
7
+ require_relative '../../helper/android/android_localize_helper'
8
+ require_relative '../../helper/git_helper'
9
9
 
10
10
  res_dir = File.join(ENV['PROJECT_ROOT_FOLDER'] || '.', params[:res_dir])
11
11
 
@@ -8,17 +8,17 @@ module Fastlane
8
8
  def self.run(params)
9
9
  UI.message "Skip confirm: #{params[:skip_confirm]}"
10
10
 
11
- require_relative '../../helper/android/android_version_helper.rb'
12
- require_relative '../../helper/android/android_git_helper.rb'
11
+ require_relative '../../helper/android/android_version_helper'
12
+ require_relative '../../helper/android/android_git_helper'
13
13
 
14
14
  UI.user_error!('This is not a release branch. Abort.') unless other_action.git_branch.start_with?('release/')
15
15
 
16
16
  version = Fastlane::Helper::Android::VersionHelper.get_public_version
17
17
  message = "Finalizing release: #{version}\n"
18
- if !params[:skip_confirm]
19
- UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
20
- else
18
+ if params[:skip_confirm]
21
19
  UI.message(message)
20
+ else
21
+ UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
22
22
  end
23
23
 
24
24
  # Check local repo status
@@ -2,7 +2,7 @@ module Fastlane
2
2
  module Actions
3
3
  class AndroidGetAlphaVersionAction < Action
4
4
  def self.run(params)
5
- require_relative '../../helper/android/android_version_helper.rb'
5
+ require_relative '../../helper/android/android_version_helper'
6
6
  Fastlane::Helper::Android::VersionHelper.get_alpha_version()
7
7
  end
8
8
 
@@ -2,7 +2,7 @@ module Fastlane
2
2
  module Actions
3
3
  class AndroidGetAppVersionAction < Action
4
4
  def self.run(params)
5
- require_relative '../../helper/android/android_version_helper.rb'
5
+ require_relative '../../helper/android/android_version_helper'
6
6
  Fastlane::Helper::Android::VersionHelper.get_public_version
7
7
  end
8
8
 
@@ -2,7 +2,7 @@ module Fastlane
2
2
  module Actions
3
3
  class AndroidGetReleaseVersionAction < Action
4
4
  def self.run(params)
5
- require_relative '../../helper/android/android_version_helper.rb'
5
+ require_relative '../../helper/android/android_version_helper'
6
6
  Fastlane::Helper::Android::VersionHelper.get_release_version()
7
7
  end
8
8
 
@@ -5,8 +5,8 @@ module Fastlane
5
5
  UI.message "Skip confirm: #{params[:skip_confirm]}"
6
6
  UI.message ''
7
7
 
8
- require_relative '../../helper/android/android_version_helper.rb'
9
- require_relative '../../helper/android/android_git_helper.rb'
8
+ require_relative '../../helper/android/android_version_helper'
9
+ require_relative '../../helper/android/android_git_helper'
10
10
 
11
11
  # Evaluate previous tag
12
12
  new_ver = params[:version_name]
@@ -16,10 +16,10 @@ module Fastlane
16
16
  message = "Requested Hotfix version: #{new_ver}\n"
17
17
  message << "Branching from: #{prev_ver}\n"
18
18
 
19
- if !params[:skip_confirm]
20
- UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
21
- else
19
+ if params[:skip_confirm]
22
20
  UI.message(message)
21
+ else
22
+ UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
23
23
  end
24
24
 
25
25
  # Check tags
@@ -21,7 +21,7 @@ module Fastlane
21
21
 
22
22
  UI.message("Merging in: #{strings_folder}")
23
23
 
24
- tmp_main_file = main_file + '.tmp'
24
+ tmp_main_file = "#{main_file}.tmp"
25
25
  FileUtils.cp(main_file, tmp_main_file)
26
26
 
27
27
  join_files = Dir.glob(File.join(strings_folder, 'strings-*.xml'))
@@ -2,8 +2,8 @@ module Fastlane
2
2
  module Actions
3
3
  class AndroidTagBuildAction < Action
4
4
  def self.run(params)
5
- require_relative '../../helper/android/android_version_helper.rb'
6
- require_relative '../../helper/android/android_git_helper.rb'
5
+ require_relative '../../helper/android/android_version_helper'
6
+ require_relative '../../helper/android/android_git_helper'
7
7
 
8
8
  release_ver = Fastlane::Helper::Android::VersionHelper.get_release_version()
9
9
  alpha_ver = Fastlane::Helper::Android::VersionHelper.get_alpha_version() unless ENV['HAS_ALPHA_VERSION'].nil?
@@ -6,7 +6,7 @@ module Fastlane
6
6
 
7
7
  class AndroidUpdateMetadataAction < Action
8
8
  def self.run(params)
9
- require_relative '../../helper/android/android_git_helper.rb'
9
+ require_relative '../../helper/android/android_git_helper'
10
10
 
11
11
  Fastlane::Helper::Android::GitHelper.update_metadata(ENV['validate_translations'])
12
12
  end
@@ -4,9 +4,9 @@ module Fastlane
4
4
  def self.run(params)
5
5
  UI.message 'Updating the release notes...'
6
6
 
7
- require_relative '../../helper/android/android_version_helper.rb'
8
- require_relative '../../helper/release_notes_helper.rb'
9
- require_relative '../../helper/git_helper.rb'
7
+ require_relative '../../helper/android/android_version_helper'
8
+ require_relative '../../helper/release_notes_helper'
9
+ require_relative '../../helper/git_helper'
10
10
 
11
11
  path = File.join(ENV['PROJECT_ROOT_FOLDER'] || '.', 'RELEASE-NOTES.txt')
12
12
  next_version = Fastlane::Helper::Android::VersionHelper.calc_next_release_short_version(params[:new_version])
@@ -0,0 +1,99 @@
1
+ require 'fastlane/action'
2
+ require 'rubygems/command_manager'
3
+
4
+ module Fastlane
5
+ module Actions
6
+ class CheckForToolkitUpdatesAction < Action
7
+ TOOLKIT_SPEC_NAME = 'fastlane-plugin-wpmreleasetoolkit'.freeze
8
+
9
+ def self.run(params)
10
+ updater = Gem::CommandManager.instance[:update]
11
+ installed_gems = updater.highest_installed_gems.select { |spec| spec == TOOLKIT_SPEC_NAME }
12
+ local_version = Gem::Version.new(installed_gems[TOOLKIT_SPEC_NAME].version)
13
+ UI.message("Currently using release toolkit version #{local_version.to_s.yellow}.")
14
+ UI.message('Checking for updates now...')
15
+ updates_needed = updater.which_to_update(installed_gems, [TOOLKIT_SPEC_NAME])
16
+
17
+ if updates_needed.empty?
18
+ UI.success('Your release toolkit is up-to-date! ✅')
19
+ return nil
20
+ end
21
+
22
+ # Return type of which_to_update differs before/after RubyGems 3.1.0, so normalize to always use Gem::NameTuple
23
+ updates_needed = Gem::NameTuple.from_list(updates_needed)
24
+ latest_version = updates_needed.find { |gem_info| gem_info.name == TOOLKIT_SPEC_NAME }.version
25
+
26
+ UI.message(['There is a newest version '.yellow, latest_version.to_s.red, ' of the release toolkit!'.yellow].join)
27
+ warn_on_breaking_update(local_version, latest_version)
28
+
29
+ return latest_version if params[:skip_update_suggestion] || !UI.confirm('Do you want to run bundle update now?')
30
+
31
+ sh('bundle', 'update', TOOLKIT_SPEC_NAME)
32
+ UI.abort_with_message! <<~UPDATE_MESSAGE
33
+ #{TOOLKIT_SPEC_NAME} have been updated. Please check and commit the changes in your Gemfile.lock file,
34
+ then restart your previous invocation of fastlane to use the new toolkit.
35
+ UPDATE_MESSAGE
36
+ end
37
+
38
+ def self.warn_on_breaking_update(current_version, latest_version)
39
+ current_semver_requirement = Gem::Requirement.new(current_version.approximate_recommendation)
40
+ compatible_update = current_semver_requirement.satisfied_by?(latest_version)
41
+ return if compatible_update
42
+
43
+ new_semver_requirement = latest_version.approximate_recommendation
44
+ UI.important <<~BREAKING_CHANGE_MESSAGE
45
+ The latest version available (#{latest_version}) introduces breaking changes compared to the #{current_version} you are currently using.
46
+
47
+ - To update to #{latest_version}, first edit your \`Pluginfile\` to use '#{new_semver_requirement}', run \`bundle update\`,
48
+ then be sure to make all the necessary changes to your \`Fastfile\` (see the toolkit's CHANGELOG)
49
+ to take those breaking changes into account.
50
+
51
+ - If you are not ready to make the major version bump, you can still try to update to the latest compatible,
52
+ non-breaking version by running \`bundle update\` now. This will not update to the latest #{latest_version}, but
53
+ might still update to a newer version compatible with '#{current_semver_requirement}' if one exists; which is still valuable
54
+ to at least get bugfixes, until you are ready to jump to the next major version later.
55
+ BREAKING_CHANGE_MESSAGE
56
+ end
57
+
58
+ def self.description
59
+ 'Check that we are on the latest version of the release toolkit, and propose to update if not'
60
+ end
61
+
62
+ def self.authors
63
+ ['Olivier Halligon']
64
+ end
65
+
66
+ def self.return_value
67
+ 'Returns the latest version of the toolkit available if your toolkit is not up-to-date, or nil if you are already up-to-date.'
68
+ end
69
+
70
+ def self.details
71
+ <<~DETAILS
72
+ Check that we are on the latest version of the release toolkit, and propose to update if not.
73
+
74
+ This action will check if you are on the *latest* version, regardless of the version requirement restriction you might have
75
+ set in your Gemfile/Pluginfile; which means that even if you agree to the prompt suggesting you to run bundle update, it might not
76
+ actually end up updating to the *latest* version automatically (esp. if the latest introduces breaking changes).
77
+
78
+ Note that if it finds an update and you then agree to the prompt and run bundle update, the action will abort your fastlane invocation
79
+ after running bundle update. This will let you check and commit the changes, before restarting the lane by re-invoking fastlane.
80
+ This is also needed to ensure fastlane loads the new toolkit version after update on second run.
81
+ DETAILS
82
+ end
83
+
84
+ def self.available_options
85
+ [
86
+ FastlaneCore::ConfigItem.new(key: :skip_update_suggestion,
87
+ env_name: 'CHECK_FOR_TOOLKIT_UPDATES_SKIP_UPDATE_SUGGESTION',
88
+ description: 'If true, will still check for new versions, but will not ask if you want to run bundle update if an update is found',
89
+ is_string: false, # Boolean
90
+ default_value: false),
91
+ ]
92
+ end
93
+
94
+ def self.is_supported?(platform)
95
+ true
96
+ end
97
+ end
98
+ end
99
+ end
@@ -2,7 +2,7 @@ module Fastlane
2
2
  module Actions
3
3
  class CircleciTriggerJobAction < Action
4
4
  def self.run(params)
5
- require_relative '../../helper/ci_helper.rb'
5
+ require_relative '../../helper/ci_helper'
6
6
 
7
7
  UI.message "Triggering job #{params[:job_params]} on branch #{params[:branch]}"
8
8