fastlane-plugin-wpmreleasetoolkit 12.3.4 → 12.5.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 (115) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_localize_libs_action.rb +2 -0
  3. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb +2 -0
  4. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_validate_lib_strings_action.rb +2 -0
  5. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_preflight.rb +2 -0
  6. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb +2 -0
  7. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_xml_release_notes.rb +2 -0
  8. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb +2 -0
  9. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_file_by_version.rb +2 -0
  10. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb +2 -0
  11. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_firebase_test.rb +2 -0
  12. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_launch_emulator_action.rb +2 -0
  13. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_send_app_size_metrics.rb +7 -5
  14. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_shutdown_emulator_action.rb +2 -0
  15. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb +2 -0
  16. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_annotate_action.rb +2 -0
  17. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_metadata_action.rb +2 -0
  18. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_pipeline_upload_action.rb +3 -1
  19. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_trigger_build_action.rb +2 -0
  20. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_for_toolkit_updates_action.rb +3 -1
  21. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb +2 -0
  22. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/circleci_trigger_job_action.rb +2 -0
  23. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/close_milestone_action.rb +2 -0
  24. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/comment_on_pr.rb +2 -0
  25. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/copy_branch_protection_action.rb +2 -0
  26. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_github_release_action.rb +2 -0
  27. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb +2 -0
  28. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_backmerge_pull_request_action.rb +3 -1
  29. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb +18 -10
  30. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/find_previous_tag.rb +2 -0
  31. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/firebase_login.rb +2 -0
  32. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_between_tags.rb +2 -0
  33. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb +2 -0
  34. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb +2 -0
  35. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/openai_ask_action.rb +143 -0
  36. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb +2 -0
  37. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/prototype_build_details_comment_action.rb +4 -2
  38. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/publish_github_release_action.rb +2 -0
  39. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb +2 -0
  40. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/set_branch_protection_action.rb +2 -0
  41. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/set_milestone_frozen_marker_action.rb +2 -0
  42. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/update_assigned_milestone_action.rb +2 -0
  43. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/upload_to_s3.rb +2 -0
  44. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb +2 -0
  45. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_apply_action.rb +2 -0
  46. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb +2 -0
  47. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb +2 -0
  48. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb +2 -0
  49. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_validate_action.rb +2 -0
  50. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_development_certificates_to_provisioning_profiles.rb +2 -0
  51. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb +2 -0
  52. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb +2 -0
  53. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_check_beta_deps.rb +5 -3
  54. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_download_strings_files_from_glotpress.rb +2 -0
  55. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_extract_keys_from_strings_files.rb +2 -0
  56. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_generate_strings_file_from_code.rb +2 -0
  57. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb +2 -0
  58. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb +14 -3
  59. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_merge_strings_files.rb +2 -0
  60. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_send_app_size_metrics.rb +5 -3
  61. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb +2 -0
  62. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb +2 -0
  63. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_emulator_helper.rb +2 -0
  64. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb +3 -1
  65. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_tools_path_helper.rb +2 -0
  66. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +6 -4
  67. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/app_size_metrics_helper.rb +2 -0
  68. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ci_helper.rb +2 -0
  69. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/configure_helper.rb +2 -0
  70. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/encryption_helper.rb +5 -7
  71. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/filesystem_helper.rb +2 -0
  72. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb +3 -1
  73. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +2 -0
  74. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/glotpress_helper.rb +2 -0
  75. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/interactive_prompt_reminder.rb +3 -1
  76. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_adc_app_sizes_helper.rb +2 -0
  77. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_helper.rb +2 -0
  78. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb +12 -8
  79. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_strings_file_validation_helper.rb +3 -1
  80. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb +2 -0
  81. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/metadata_block.rb +2 -0
  82. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/release_note_metadata_block.rb +2 -0
  83. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/release_note_short_metadata_block.rb +2 -0
  84. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/standard_metadata_block.rb +2 -0
  85. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/unknown_metadata_block.rb +2 -0
  86. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/whats_new_metadata_block.rb +2 -0
  87. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb +2 -0
  88. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb +2 -0
  89. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/release_notes_helper.rb +2 -0
  90. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/user_agent.rb +3 -1
  91. data/lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb +2 -0
  92. data/lib/fastlane/plugin/wpmreleasetoolkit/models/build_code.rb +2 -0
  93. data/lib/fastlane/plugin/wpmreleasetoolkit/models/configuration.rb +2 -0
  94. data/lib/fastlane/plugin/wpmreleasetoolkit/models/file_reference.rb +2 -0
  95. data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_account.rb +2 -0
  96. data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_device.rb +2 -0
  97. data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_test_lab_result.rb +2 -0
  98. data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_test_runner.rb +2 -0
  99. data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
  100. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/abstract_version_calculator.rb +2 -0
  101. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/date_build_code_calculator.rb +2 -0
  102. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/date_version_calculator.rb +2 -0
  103. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/marketing_version_calculator.rb +2 -0
  104. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/semantic_version_calculator.rb +2 -0
  105. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/simple_build_code_calculator.rb +2 -0
  106. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/files/android_version_file.rb +2 -0
  107. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/files/ios_version_file.rb +2 -0
  108. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/formatters/abstract_version_formatter.rb +2 -0
  109. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/formatters/derived_build_code_formatter.rb +2 -0
  110. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/formatters/four_part_build_code_formatter.rb +2 -0
  111. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/formatters/four_part_version_formatter.rb +2 -0
  112. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/formatters/rc_notation_version_formatter.rb +3 -1
  113. data/lib/fastlane/plugin/wpmreleasetoolkit/versioning/formatters/simple_build_code_formatter.rb +2 -0
  114. data/lib/fastlane/plugin/wpmreleasetoolkit.rb +2 -0
  115. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b59d8ce8652d5491809fc8a80bf3e08b35a3d65f244eb9f7f8faccb212ba9c81
4
- data.tar.gz: aea9e1d13eb564f07088120c9f763aa2042bc34c0672ca938670b0ee1e698209
3
+ metadata.gz: 54ad163793f5102f88dd8a4a82408cd73bd5bb5d084354f4ea8d21f90cb994b5
4
+ data.tar.gz: 7d627bd253b7b2c9be0b990108caffb1a0b1a9056466afa98628fe4e27b79c2a
5
5
  SHA512:
6
- metadata.gz: c3dca2f486e3ff752f89b8b27a36d5f2287dc9c529eb46efe10ca6c6168ebfa595489921ae4a550c80e6b1f10f616401ba53e8e1ce102210f478c79f16bbde6a
7
- data.tar.gz: 3dc7792faa4d46efabde9c7075f198dae635b15be7a9cc9a157610c23fec524ed3a5ebb28e6e3377cb0e5313a313579debcc1ee41abb10308eaafcb063b0c427
6
+ metadata.gz: 545ce35d03805a5deb7c30ed22e01f55106d0a8420a89a355f2ff8047ddddef2b433294da5a86d6a5c1ca460c0d3f1c08215396b637faa50d9aca7be5823c2f2
7
+ data.tar.gz: fc4d77d82c952c610f73c823d4b8548a83627ceac6ba79101e8a235e3851e16fefbc4bdd7f1c87cc0f89ee68194b95c4570bb798923006aa1121de66b57ca6ab
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require_relative '../../helper/android/android_localize_helper'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require_relative '../../helper/metadata/release_note_metadata_block'
3
5
  require_relative '../../helper/metadata/release_note_short_metadata_block'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require_relative '../../helper/android/android_localize_helper'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class AndroidBuildPreflightAction < Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class AndroidCreateAvdAction < Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class AndroidCreateXmlReleaseNotesAction < Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  module SharedValues
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class AndroidDownloadFileByVersionAction < Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This action is the new version of android_update_metadata (AndroidUpdateMetadataAction) and should now be used instead of that one
2
4
 
3
5
  module Fastlane
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'securerandom'
2
4
 
3
5
  module Fastlane
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class AndroidLaunchEmulatorAction < Action
@@ -1,14 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../../helper/app_size_metrics_helper'
2
4
 
3
5
  module Fastlane
4
6
  module Actions
5
7
  class AndroidSendAppSizeMetricsAction < Action
6
8
  # Keys used by the metrics payload
7
- AAB_FILE_SIZE_KEY = 'AAB File Size'.freeze # value from `File.size` of the `.aab`
8
- UNIVERSAL_APK_FILE_SIZE_KEY = 'Universal APK File Size'.freeze # value from `File.size` of the Universal `.apk`
9
- UNIVERSAL_APK_SPLIT_NAME = 'Universal'.freeze # pseudo-name of the split representing the Universal `.apk`
10
- APK_OPTIMIZED_FILE_SIZE_KEY = 'Optimized APK File Size'.freeze # value from `apkanalyzer apk file-size`
11
- APK_OPTIMIZED_DOWNLOAD_SIZE_KEY = 'Download Size'.freeze # value from `apkanalyzer apk download-size`
9
+ AAB_FILE_SIZE_KEY = 'AAB File Size' # value from `File.size` of the `.aab`
10
+ UNIVERSAL_APK_FILE_SIZE_KEY = 'Universal APK File Size' # value from `File.size` of the Universal `.apk`
11
+ UNIVERSAL_APK_SPLIT_NAME = 'Universal' # pseudo-name of the split representing the Universal `.apk`
12
+ APK_OPTIMIZED_FILE_SIZE_KEY = 'Optimized APK File Size' # value from `apkanalyzer apk file-size`
13
+ APK_OPTIMIZED_DOWNLOAD_SIZE_KEY = 'Download Size' # value from `apkanalyzer apk download-size`
12
14
 
13
15
  def self.run(params)
14
16
  # Check input parameters
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class AndroidShutdownEmulatorAction < Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class AndroidUpdateReleaseNotesAction < Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class BuildkiteAnnotateAction < Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class BuildkiteMetadataAction < Action
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class BuildkitePipelineUploadAction < Action
4
- DEFAULT_BUILDKITE_PIPELINE_FOLDER = '.buildkite'.freeze
6
+ DEFAULT_BUILDKITE_PIPELINE_FOLDER = '.buildkite'
5
7
  DEFAULT_ENV_FILE = File.join(DEFAULT_BUILDKITE_PIPELINE_FOLDER, 'shared-pipeline-vars').freeze
6
8
 
7
9
  def self.run(params)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class BuildkiteTriggerBuildAction < Action
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require 'rubygems/command_manager'
3
5
 
4
6
  module Fastlane
5
7
  module Actions
6
8
  class CheckForToolkitUpdatesAction < Action
7
- TOOLKIT_SPEC_NAME = 'fastlane-plugin-wpmreleasetoolkit'.freeze
9
+ TOOLKIT_SPEC_NAME = 'fastlane-plugin-wpmreleasetoolkit'
8
10
 
9
11
  def self.run(params)
10
12
  updater = Gem::CommandManager.instance[:update]
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class CheckTranslationProgressAction < Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class CircleciTriggerJobAction < Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require 'date'
3
5
  require_relative '../../helper/github_helper'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
 
3
5
  module Fastlane
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require_relative '../../helper/github_helper'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require 'date'
3
5
  require_relative '../../helper/github_helper'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require 'date'
3
5
  require_relative '../../helper/github_helper'
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require_relative '../../helper/github_helper'
3
5
 
4
6
  module Fastlane
5
7
  module Actions
6
8
  class CreateReleaseBackmergePullRequestAction < Action
7
- DEFAULT_BRANCH = 'trunk'.freeze
9
+ DEFAULT_BRANCH = 'trunk'
8
10
 
9
11
  def self.run(params)
10
12
  token = params[:github_token]
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
 
3
5
  module Fastlane
@@ -8,16 +10,18 @@ module Fastlane
8
10
  release_notes_file_path = params[:release_notes_file_path]
9
11
  extracted_notes_file_path = params[:extracted_notes_file_path]
10
12
 
11
- extracted_notes_file = File.open(extracted_notes_file_path, 'w') unless extracted_notes_file_path.blank?
12
-
13
+ extracted_notes = ''
13
14
  extract_notes(release_notes_file_path, version) do |line|
14
- extracted_notes_file.nil? ? puts(line) : extracted_notes_file.write(line)
15
+ extracted_notes += line
15
16
  end
17
+ extracted_notes.chomp!('') # Remove any extra empty line(s) at the end
16
18
 
17
- return if extracted_notes_file.nil?
19
+ unless extracted_notes_file_path.nil? || extracted_notes_file_path.empty?
20
+ File.write(extracted_notes_file_path, extracted_notes)
21
+ commit_extracted_notes_file(extracted_notes_file_path, version)
22
+ end
18
23
 
19
- extracted_notes_file.close
20
- check_and_commit_extracted_notes_file(extracted_notes_file_path, version)
24
+ extracted_notes
21
25
  end
22
26
 
23
27
  def self.extract_notes(release_notes_file_path, version)
@@ -39,9 +43,13 @@ module Fastlane
39
43
  end
40
44
  end
41
45
 
42
- def self.check_and_commit_extracted_notes_file(file_path, version)
43
- Action.sh("git add #{file_path}")
44
- Action.sh("git diff-index --quiet HEAD || git commit -m \"Update draft release notes for #{version}.\"")
46
+ def self.commit_extracted_notes_file(file_path, version)
47
+ other_action.git_add(path: file_path)
48
+ other_action.git_commit(
49
+ path: file_path,
50
+ message: "Update draft release notes for #{version}",
51
+ allow_nothing_to_commit: true
52
+ )
45
53
  end
46
54
 
47
55
  def self.description
@@ -53,7 +61,7 @@ module Fastlane
53
61
  end
54
62
 
55
63
  def self.return_value
56
- # If your method provides a return value, you can describe here what it does
64
+ 'The content of the extracted release notes (the same text as what was written in the `extracted_notes_file_path` if one was provided)'
57
65
  end
58
66
 
59
67
  def self.details
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require_relative '../../helper/github_helper'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'securerandom'
2
4
 
3
5
  module Fastlane
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require_relative '../../helper/github_helper'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require_relative '../../helper/metadata_download_helper'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../../helper/metadata/release_note_metadata_block'
2
4
  require_relative '../../helper/metadata/release_note_short_metadata_block'
3
5
  require_relative '../../helper/metadata/whats_new_metadata_block'
@@ -0,0 +1,143 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fastlane/action'
4
+ require 'net/http'
5
+ require 'json'
6
+
7
+ module Fastlane
8
+ module Actions
9
+ class OpenaiAskAction < Action
10
+ OPENAI_API_ENDPOINT = URI('https://api.openai.com/v1/chat/completions').freeze
11
+
12
+ PREDEFINED_PROMPTS = {
13
+ release_notes: <<~PROMPT
14
+ Act like a mobile app marketer who wants to prepare release notes for Google Play and App Store.
15
+ Do not write it point by point and keep it under 350 characters. It should be a unique paragraph.
16
+
17
+ When provided a list, use the number of any potential "*" in brackets at the start of each item as indicator of importance.
18
+ Ignore items starting with "[Internal]", and ignore links to GitHub.
19
+ PROMPT
20
+ }.freeze
21
+
22
+ def self.run(params)
23
+ api_token = params[:api_token]
24
+ prompt = params[:prompt]
25
+ prompt = PREDEFINED_PROMPTS[prompt] if PREDEFINED_PROMPTS.key?(prompt)
26
+ question = params[:question]
27
+
28
+ headers = {
29
+ 'Content-Type': 'application/json',
30
+ Authorization: "Bearer #{api_token}"
31
+ }
32
+ body = request_body(prompt: prompt, question: question)
33
+
34
+ response = Net::HTTP.post(OPENAI_API_ENDPOINT, body, headers)
35
+
36
+ case response
37
+ when Net::HTTPOK
38
+ json = JSON.parse(response.body)
39
+ json['choices']&.first&.dig('message', 'content')
40
+ else
41
+ UI.user_error!("Error in OpenAI API response: #{response}. #{response.body}")
42
+ end
43
+ end
44
+
45
+ def self.request_body(prompt:, question:)
46
+ {
47
+ model: 'gpt-4o',
48
+ response_format: { type: 'text' },
49
+ temperature: 1,
50
+ max_tokens: 2048,
51
+ top_p: 1,
52
+ messages: [
53
+ format_message(role: 'system', text: prompt),
54
+ format_message(role: 'user', text: question),
55
+ ].compact
56
+ }.to_json
57
+ end
58
+
59
+ def self.format_message(role:, text:)
60
+ return nil if text.nil? || text.empty?
61
+
62
+ {
63
+ role: role,
64
+ content: [{ type: 'text', text: text }]
65
+ }
66
+ end
67
+
68
+ #####################################################
69
+ # @!group Documentation
70
+ #####################################################
71
+
72
+ def self.description
73
+ 'Use OpenAI API to generate response to a prompt'
74
+ end
75
+
76
+ def self.authors
77
+ ['Automattic']
78
+ end
79
+
80
+ def self.return_value
81
+ 'The response text from the prompt as returned by OpenAI API'
82
+ end
83
+
84
+ def self.details
85
+ <<~DETAILS
86
+ Uses the OpenAI API to generate response to a prompt.
87
+ Can be used to e.g. ask it to generate Release Notes based on a bullet point technical changelog or similar.
88
+ DETAILS
89
+ end
90
+
91
+ def self.examples
92
+ [
93
+ <<~EXEMPLE,
94
+ items = extract_release_notes_for_version(version: app_version, release_notes_file_path: 'RELEASE-NOTES.txt')
95
+ nice_changelog = openai_ask(
96
+ prompt: :release_notes, # Uses the pre-crafted prompt for App Store / Play Store release notes
97
+ question: "Help me write release notes for the following items:\n#{items}",
98
+ api_token: get_required_env('OPENAI_API_TOKEN')
99
+ )
100
+ File.write(File.join('fastlane', 'metadata', 'android', 'en-US', 'changelogs', 'default.txt'), nice_changelog)
101
+ EXEMPLE
102
+ ]
103
+ end
104
+
105
+ def self.available_prompt_symbols
106
+ PREDEFINED_PROMPTS.keys.map { |v| "`:#{v}`" }.join(',')
107
+ end
108
+
109
+ def self.available_options
110
+ [
111
+ FastlaneCore::ConfigItem.new(key: :prompt,
112
+ description: 'The internal top-level instructions to give to the model to tell it how to behave. ' \
113
+ + "Use a Ruby Symbol from one of [#{available_prompt_symbols}] to use a predefined prompt instead of writing your own",
114
+ optional: true,
115
+ default_value: nil,
116
+ type: String,
117
+ skip_type_validation: true,
118
+ verify_block: proc do |value|
119
+ next if value.is_a?(String)
120
+ next if PREDEFINED_PROMPTS.include?(value)
121
+
122
+ UI.user_error!("Parameter `prompt` can only be a String or one of the following Symbols: [#{available_prompt_symbols}]")
123
+ end),
124
+ FastlaneCore::ConfigItem.new(key: :question,
125
+ description: 'The user message to ask the question to the OpenAI model',
126
+ optional: false,
127
+ default_value: nil,
128
+ type: String),
129
+ FastlaneCore::ConfigItem.new(key: :api_token,
130
+ description: 'The OpenAI API Token to use for the request',
131
+ env_name: 'OPENAI_API_TOKEN',
132
+ optional: false,
133
+ sensitive: true,
134
+ type: String),
135
+ ]
136
+ end
137
+
138
+ def self.is_supported?(_platform)
139
+ true
140
+ end
141
+ end
142
+ end
143
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fileutils'
2
4
  require 'fastlane/action'
3
5
  require 'active_support/all'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class PrototypeBuildDetailsCommentAction < Action
@@ -36,13 +38,13 @@ module Fastlane
36
38
  # @!group Helpers
37
39
  #####################################################
38
40
 
39
- NO_INSTALL_URL_ERROR_MESSAGE = <<~NO_URL_ERROR.freeze
41
+ NO_INSTALL_URL_ERROR_MESSAGE = <<~NO_URL_ERROR
40
42
  No URL provided to download or install the app.
41
43
  - Either use this action right after using `appcenter_upload` and provide an `app_center_org_name` (so that this action can use the link to the App Center build)
42
44
  - Or provide an explicit value for the `download_url` parameter
43
45
  NO_URL_ERROR
44
46
 
45
- DEFAULT_APP_CENTER_FOOTNOTE = '<em>Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.</em>'.freeze
47
+ DEFAULT_APP_CENTER_FOOTNOTE = '<em>Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.</em>'
46
48
 
47
49
  # A small model struct to consolidate and pack all the values related to App Center
48
50
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require_relative '../../helper/github_helper'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require_relative '../../helper/github_helper'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require_relative '../../helper/github_helper'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require_relative '../../helper/github_helper'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require_relative '../../helper/github_helper'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require 'digest/sha1'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require 'fastlane_core/ui/ui'
3
5
  require 'fileutils'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require 'fastlane_core/ui/ui'
3
5
  require 'fileutils'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require 'fastlane_core/ui/ui'
3
5
  require 'fileutils'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require 'fastlane_core/ui/ui'
3
5
  require 'fileutils'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require 'fastlane_core/ui/ui'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require 'fastlane_core/ui/ui'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class AddDevelopmentCertificatesToProvisioningProfilesAction < Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class AddAllDevicesToProvisioningProfilesAction < Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class IosBuildPreflightAction < Action
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
 
3
5
  module Fastlane
4
6
  module Actions
5
7
  class IosCheckBetaDepsAction < Action
6
- ALL_PODS_STABLE_MESSAGE = 'All pods are pointing to a stable version. You can continue with the code freeze.'.freeze
7
- NON_STABLE_PODS_MESSAGE = "Please create a new stable version of those pods and update the Podfile to the newly released version before continuing with the code freeze:\n".freeze
8
+ ALL_PODS_STABLE_MESSAGE = 'All pods are pointing to a stable version. You can continue with the code freeze.'
9
+ NON_STABLE_PODS_MESSAGE = "Please create a new stable version of those pods and update the Podfile to the newly released version before continuing with the code freeze:\n"
8
10
 
9
11
  def self.run(params)
10
12
  yaml = YAML.load_file(params[:lockfile])
@@ -31,7 +33,7 @@ module Fastlane
31
33
  end
32
34
  end
33
35
 
34
- message = ''
36
+ message = String.new
35
37
  if non_stable_pods.empty?
36
38
  message << ALL_PODS_STABLE_MESSAGE
37
39
  else