fastlane-plugin-wpmreleasetoolkit 6.3.0 → 7.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb +5 -5
  3. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_validate_lib_strings_action.rb +17 -5
  4. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +2 -2
  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_hotfix.rb +2 -2
  7. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +1 -1
  8. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +4 -2
  9. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_xml_release_notes.rb +4 -4
  10. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb +1 -1
  11. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +4 -2
  12. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_hotfix_prechecks.rb +2 -2
  13. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb +1 -1
  14. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb +2 -2
  15. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_annotate_action.rb +85 -0
  16. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_metadata_action.rb +67 -0
  17. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_trigger_build_action.rb +10 -2
  18. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_for_toolkit_updates_action.rb +4 -4
  19. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb +2 -2
  20. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb +3 -3
  21. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb +2 -2
  22. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb +3 -3
  23. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_list_action.rb +2 -2
  24. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb +4 -4
  25. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb +5 -5
  26. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/prototype_build_details_comment_action.rb +259 -0
  27. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setfrozentag_action.rb +2 -2
  28. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_apply_action.rb +1 -1
  29. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb +1 -1
  30. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_development_certificates_to_provisioning_profiles.rb +2 -2
  31. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb +2 -2
  32. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb +3 -3
  33. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb +4 -4
  34. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb +1 -1
  35. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +3 -3
  36. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb +3 -21
  37. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_check_beta_deps.rb +1 -1
  38. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_clear_intermediate_tags.rb +15 -3
  39. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb +1 -1
  40. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb +4 -2
  41. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_download_strings_files_from_glotpress.rb +1 -1
  42. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_extract_keys_from_strings_files.rb +2 -2
  43. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb +15 -3
  44. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb +4 -2
  45. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_generate_strings_file_from_code.rb +3 -3
  46. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_number.rb +54 -0
  47. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb +1 -1
  48. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_hotfix_prechecks.rb +2 -2
  49. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb +3 -3
  50. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb +2 -2
  51. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb +2 -2
  52. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/an_metadata_update_helper.rb +2 -2
  53. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb +2 -2
  54. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +2 -2
  55. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb +17 -0
  56. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/glotpress_helper.rb +1 -1
  57. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb +1 -1
  58. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb +2 -2
  59. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_update_helper.rb +1 -1
  60. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb +1 -1
  61. data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
  62. metadata +12 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc23b6dcb021398be08fc810b93dcc9429944c774d9b3cd05c03fcd66195b362
4
- data.tar.gz: 03d51d5aa7598aa1e3eb72b96a4b7209d0644324ff7df745a61219a581a266fb
3
+ metadata.gz: b286d607c113865f2a5d33d8db29249707512df476c8e5eae1cff8d3a95e5505
4
+ data.tar.gz: '0528769e462fd860198a521ef40cb122749e02d850ea2b606cb09507df3a77e1'
5
5
  SHA512:
6
- metadata.gz: 3d79e772d831bb4d95897f319d938bcd23e365dc95c0c8a8b341a3238088ca31f95317a1e5079b51d417f28d0f392b3747e65e9b5d90be2be291fd6c94fca4d5
7
- data.tar.gz: 7d6d28cff026fad6962601f7202a9cc900f3cba0db4155c0ed0c9b1b90b816a40cf340e41e742c68db2698d689fd70f91692995a176ba7d855b27a47e0c7b797
6
+ metadata.gz: 2b5423b8737e2b728eccdcedfb10347ac63520f483b11d890a951e82c0ce56595f82f39cae61246d53fe2a40e571978e9987b96a31194eb435e0754df6038121
7
+ data.tar.gz: 25c280a976457435191325c8aa153824bb672f9c77926b4df2c9f28f98b6cfb5f03ac2f9be3f7814fa95805ee47f0a2c414a019b44a17f8b717a079dbf748a72
@@ -37,7 +37,7 @@ module Fastlane
37
37
  target = self.create_target_file_path(orig)
38
38
 
39
39
  # Clear if older exists
40
- File.delete(target) if File.exist? target
40
+ FileUtils.rm_f(target)
41
41
 
42
42
  # Create the new one
43
43
  begin
@@ -47,7 +47,7 @@ module Fastlane
47
47
  end
48
48
  end
49
49
  rescue
50
- File.delete(target) if File.exist? target
50
+ FileUtils.rm_f(target)
51
51
  raise
52
52
  end
53
53
 
@@ -57,7 +57,7 @@ module Fastlane
57
57
  # Deletes the old po and moves the temp one
58
58
  # to the final location
59
59
  def self.swap_po(orig_file_path, temp_file_path)
60
- File.delete(orig_file_path) if File.exist? orig_file_path
60
+ FileUtils.rm_f(orig_file_path)
61
61
  File.rename(temp_file_path, orig_file_path)
62
62
  end
63
63
 
@@ -131,7 +131,7 @@ module Fastlane
131
131
  FastlaneCore::ConfigItem.new(key: :po_file_path,
132
132
  env_name: 'FL_UPDATE_METADATA_SOURCE_PO_FILE_PATH',
133
133
  description: 'The path of the .po file to update',
134
- is_string: true,
134
+ type: String,
135
135
  verify_block: proc do |value|
136
136
  UI.user_error!("No .po file path for UpdateMetadataSourceAction given, pass using `po_file_path: 'file path'`") unless value && (!value.empty?)
137
137
  UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
@@ -145,7 +145,7 @@ module Fastlane
145
145
  FastlaneCore::ConfigItem.new(key: :source_files,
146
146
  env_name: 'FL_UPDATE_METADATA_SOURCE_SOURCE_FILES',
147
147
  description: 'The hash with the path to the source files and the key to use to include their content',
148
- is_string: false,
148
+ type: Hash,
149
149
  verify_block: proc do |value|
150
150
  UI.user_error!("No source file hash for UpdateMetadataSourceAction given, pass using `source_files: 'source file hash'`") unless value && (!value.empty?)
151
151
  end),
@@ -33,7 +33,19 @@ module Fastlane
33
33
  end
34
34
 
35
35
  def self.details
36
- 'Checks that the strings to be localised are updated from the libs into the main application file'
36
+ <<~DETAILS
37
+ Checks that the strings to be localised are updated from the libs into the main application file
38
+
39
+ For the `lib_strings_path` ConfigItem, it is an array of Hashes, each describing a library and
40
+ containing these specific keys:
41
+ - `:library`: The human readable name of the library, used to display in console messages
42
+ - `:strings_path`: The path to the strings.xml file of the library to merge into the main one
43
+ - `:exclusions`: An array of strings keys to exclude during merge. Any of those keys from the
44
+ library's `strings.xml` will be skipped and won't be merged into the main one.
45
+ - `:source_id`: An optional `String` which will be added as the `a8c-src-lib` XML attribute
46
+ to strings coming from this library, to help identify their source in the merged file.
47
+ - `:add_ignore_attr`: If set to `true`, will add `tools:ignore="UnusedResources"` to merged strings.
48
+ DETAILS
37
49
  end
38
50
 
39
51
  def self.available_options
@@ -41,17 +53,17 @@ module Fastlane
41
53
  FastlaneCore::ConfigItem.new(key: :app_strings_path,
42
54
  description: 'The path of the main strings file',
43
55
  optional: false,
44
- is_string: true),
56
+ type: String),
45
57
  FastlaneCore::ConfigItem.new(key: :libs_strings_path,
46
58
  env_name: 'CHECK_LIBS_STRINGS_PATH',
47
- description: 'The list of libs to merge',
59
+ description: 'The list of libs to merge. This should be an array of Hashes.',
48
60
  optional: false,
49
- is_string: false),
61
+ type: Array),
50
62
  FastlaneCore::ConfigItem.new(key: :diff_url,
51
63
  env_name: 'CHECK_LIBS_DIFF_URL',
52
64
  description: 'The url of the diff to check',
53
65
  optional: true,
54
- is_string: true),
66
+ type: String),
55
67
  ]
56
68
  end
57
69
 
@@ -74,12 +74,12 @@ module Fastlane
74
74
  FastlaneCore::ConfigItem.new(key: :base_version,
75
75
  env_name: 'FL_ANDROID_BETABUILD_PRECHECKS_BASE_VERSION',
76
76
  description: 'The version to work on', # a short description of this parameter
77
- is_string: true,
77
+ type: String,
78
78
  optional: true), # true: verifies the input is a string, false: every kind of value),
79
79
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
80
80
  env_name: 'FL_ANDROID_BETABUILD_PRECHECKS_SKIPCONFIRM',
81
81
  description: 'Skips confirmation',
82
- is_string: false, # true: verifies the input is a string, false: every kind of value
82
+ type: Boolean,
83
83
  default_value: false), # the default value if the user didn't provide one
84
84
  FastlaneCore::ConfigItem.new(key: :default_branch,
85
85
  env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
@@ -46,22 +46,22 @@ module Fastlane
46
46
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
47
47
  env_name: 'FL_ANDROID_BUILD_PRECHECKS_SKIP_CONFIRM',
48
48
  description: 'True to avoid the system ask for confirmation',
49
- is_string: false,
49
+ type: Boolean,
50
50
  default_value: false),
51
51
  FastlaneCore::ConfigItem.new(key: :alpha,
52
52
  env_name: 'FL_ANDROID_BUILD_PRECHECKS_ALPHA_BUILD',
53
53
  description: 'True if this is for an alpha build',
54
- is_string: false,
54
+ type: Boolean,
55
55
  default_value: false),
56
56
  FastlaneCore::ConfigItem.new(key: :beta,
57
57
  env_name: 'FL_ANDROID_BUILD_PRECHECKS_BETA_BUILD',
58
58
  description: 'True if this is for a beta build',
59
- is_string: false,
59
+ type: Boolean,
60
60
  default_value: false),
61
61
  FastlaneCore::ConfigItem.new(key: :final,
62
62
  env_name: 'FL_ANDROID_BUILD_PRECHECKS_FINAL_BUILD',
63
63
  description: 'True if this is for a final build',
64
- is_string: false,
64
+ type: Boolean,
65
65
  default_value: false),
66
66
  ]
67
67
  end
@@ -43,14 +43,14 @@ module Fastlane
43
43
  FastlaneCore::ConfigItem.new(key: :version_name,
44
44
  env_name: 'FL_ANDROID_BUMP_VERSION_HOTFIX_VERSION',
45
45
  description: 'The version name for the hotfix',
46
- is_string: true),
46
+ type: String),
47
47
  FastlaneCore::ConfigItem.new(key: :version_code,
48
48
  env_name: 'FL_ANDROID_BUMP_VERSION_HOTFIX_CODE',
49
49
  description: 'The version code for the hotfix'),
50
50
  FastlaneCore::ConfigItem.new(key: :previous_version_name,
51
51
  env_name: 'FL_ANDROID_BUMP_VERSION_HOTFIX_PREVIOUS_VERSION',
52
52
  description: 'The version to branch from',
53
- is_string: true),
53
+ type: String),
54
54
  ]
55
55
  end
56
56
 
@@ -57,7 +57,7 @@ module Fastlane
57
57
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
58
58
  env_name: 'FL_ANDROID_CODEFREEZE_PRECHECKS_SKIPCONFIRM',
59
59
  description: 'Skips confirmation before codefreeze',
60
- is_string: false, # true: verifies the input is a string, false: every kind of value
60
+ type: Boolean,
61
61
  default_value: false), # the default value if the user didn't provide one
62
62
  FastlaneCore::ConfigItem.new(key: :default_branch,
63
63
  env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
@@ -6,8 +6,10 @@ module Fastlane
6
6
 
7
7
  require_relative '../../helper/android/android_version_helper'
8
8
  require_relative '../../helper/android/android_git_helper'
9
+ require_relative '../../helper/git_helper'
9
10
 
10
- UI.user_error!('This is not a release branch. Abort.') unless other_action.git_branch.start_with?('release/')
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/')
11
13
 
12
14
  version = Fastlane::Helper::Android::VersionHelper.get_public_version
13
15
  message = "Completing code freeze for: #{version}\n"
@@ -40,7 +42,7 @@ module Fastlane
40
42
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
41
43
  env_name: 'FL_ANDROID_COMPLETECODEFREEZE_PRECHECKS_SKIPCONFIRM',
42
44
  description: 'Skips confirmation',
43
- is_string: false, # true: verifies the input is a string, false: every kind of value
45
+ type: Boolean,
44
46
  default_value: false), # the default value if the user didn't provide one
45
47
  ]
46
48
  end
@@ -11,7 +11,7 @@ module Fastlane
11
11
  complete_path = "#{params[:download_path]}/#{loc[1]}/changelogs/#{params[:build_number]}.txt"
12
12
  if File.exist?(complete_path)
13
13
  f.puts("<#{loc[1]}>")
14
- f.puts(File.open(complete_path).read)
14
+ f.puts(File.read(complete_path))
15
15
  f.puts("</#{loc[1]}>\n")
16
16
  else
17
17
  UI.message("File #{complete_path} not found. Skipping language #{loc[1]}")
@@ -38,16 +38,16 @@ module Fastlane
38
38
  env_name: 'ANDROID_XML_NOTES_DOWNLOAD_PATH',
39
39
  description: 'The path to the folder with the release notes',
40
40
  optional: false,
41
- is_string: true),
41
+ type: String),
42
42
  FastlaneCore::ConfigItem.new(key: :build_number,
43
43
  env_name: 'ANDROID_XML_NOTES_BUILD_NUMBER',
44
44
  description: 'The build number of the release notes',
45
45
  optional: false,
46
- is_string: true),
46
+ type: String),
47
47
  FastlaneCore::ConfigItem.new(key: :locales,
48
48
  env_name: 'FL_DOWNLOAD_METADATA_LOCALES',
49
49
  description: 'The hash with the GLotPress locale and the project locale association',
50
- is_string: false),
50
+ type: Hash),
51
51
  ]
52
52
  end
53
53
 
@@ -91,7 +91,7 @@ module Fastlane
91
91
  key: :skip_commit,
92
92
  env_name: 'FL_DOWNLOAD_TRANSLATIONS_SKIP_COMMIT',
93
93
  description: 'If set to true, will skip the commit/push step. Otherwise, it will commit the changes and push them (the default)',
94
- is_string: false, # Boolean
94
+ type: Boolean,
95
95
  default_value: false
96
96
  ),
97
97
  ]
@@ -10,8 +10,10 @@ module Fastlane
10
10
 
11
11
  require_relative '../../helper/android/android_version_helper'
12
12
  require_relative '../../helper/android/android_git_helper'
13
+ require_relative '../../helper/git_helper'
13
14
 
14
- UI.user_error!('This is not a release branch. Abort.') unless other_action.git_branch.start_with?('release/')
15
+ current_branch = Fastlane::Helper::GitHelper.current_git_branch
16
+ UI.user_error!("Current branch - '#{current_branch}' - is not a release branch. Abort.") unless current_branch.start_with?('release/')
15
17
 
16
18
  version = Fastlane::Helper::Android::VersionHelper.get_public_version
17
19
  message = "Finalizing release: #{version}\n"
@@ -47,7 +49,7 @@ module Fastlane
47
49
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
48
50
  env_name: 'FL_ANDROID_FINALIZE_PRECHECKS_SKIPCONFIRM',
49
51
  description: 'Skips confirmation',
50
- is_string: false, # true: verifies the input is a string, false: every kind of value
52
+ type: Boolean,
51
53
  default_value: false), # the default value if the user didn't provide one
52
54
  ]
53
55
  end
@@ -51,11 +51,11 @@ module Fastlane
51
51
  FastlaneCore::ConfigItem.new(key: :version_name,
52
52
  env_name: 'FL_ANDROID_HOTFIX_PRECHECKS_VERSION',
53
53
  description: 'The hotfix version number to create',
54
- is_string: true),
54
+ type: String),
55
55
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
56
56
  env_name: 'FL_ANDROID_HOTFIX_PRECHECKS_SKIPCONFIRM',
57
57
  description: 'Skips confirmation',
58
- is_string: false, # Boolean
58
+ type: Boolean,
59
59
  default_value: false),
60
60
  ]
61
61
  end
@@ -28,7 +28,7 @@ module Fastlane
28
28
  FastlaneCore::ConfigItem.new(key: :tag_alpha,
29
29
  env_name: 'FL_ANDROID_TAG_BUILD_ALPHA',
30
30
  description: 'True to skip tagging the alpha version',
31
- is_string: false,
31
+ type: Boolean,
32
32
  default_value: true),
33
33
  ]
34
34
  end
@@ -34,11 +34,11 @@ module Fastlane
34
34
  FastlaneCore::ConfigItem.new(key: :new_version,
35
35
  env_name: 'FL_ANDROID_UPDATE_RELEASE_NOTES_VERSION',
36
36
  description: 'The version we are currently freezing; An empty entry for the _next_ version after this one will be added to the release notes',
37
- is_string: true),
37
+ type: String),
38
38
  FastlaneCore::ConfigItem.new(key: :release_notes_file_path,
39
39
  env_name: 'FL_ANDROID_UPDATE_RELEASE_NOTES_FILE_PATH',
40
40
  description: 'The path to the release notes file to be updated',
41
- is_string: true,
41
+ type: String,
42
42
  default_value: File.join(ENV['PROJECT_ROOT_FOLDER'] || '.', 'RELEASE-NOTES.txt')),
43
43
  ]
44
44
  end
@@ -0,0 +1,85 @@
1
+ module Fastlane
2
+ module Actions
3
+ class BuildkiteAnnotateAction < Action
4
+ def self.run(params)
5
+ message = params[:message]
6
+ context = params[:context]
7
+ style = params[:style]
8
+
9
+ if message.nil?
10
+ # Delete an annotation, but swallow the error if the annotation didn't exist — to avoid having
11
+ # this action failing or printing a red log for no good reason — hence the `|| true`
12
+ ctx_param = "--context #{context.shellescape}" unless context.nil?
13
+ sh("buildkite-agent annotation remove #{ctx_param} || true")
14
+ else
15
+ # Add new annotation using `buildkite-agent`
16
+ extra_params = {
17
+ context: context,
18
+ style: style
19
+ }.compact.flat_map { |k, v| ["--#{k}", v] }
20
+ sh('buildkite-agent', 'annotate', *extra_params, params[:message])
21
+ end
22
+ end
23
+
24
+ #####################################################
25
+ # @!group Documentation
26
+ #####################################################
27
+
28
+ def self.description
29
+ 'Add or remove annotations to the current Buildkite build'
30
+ end
31
+
32
+ def self.details
33
+ <<~DETAILS
34
+ Add or remove annotations to the current Buildkite build.
35
+
36
+ Has to be run on a CI job (where a `buildkite-agent` is running), e.g. typically by a lane
37
+ that is triggered as part of a Buildkite CI step.
38
+
39
+ See https://buildkite.com/docs/agent/v3/cli-annotate
40
+ DETAILS
41
+ end
42
+
43
+ def self.available_options
44
+ [
45
+ FastlaneCore::ConfigItem.new(
46
+ key: :context,
47
+ env_name: 'BUILDKITE_ANNOTATION_CONTEXT',
48
+ description: 'The context of the annotation used to differentiate this annotation from others',
49
+ type: String,
50
+ optional: true
51
+ ),
52
+ FastlaneCore::ConfigItem.new(
53
+ key: :style,
54
+ env_name: 'BUILDKITE_ANNOTATION_STYLE',
55
+ description: 'The style of the annotation (`success`, `info`, `warning` or `error`)',
56
+ type: String,
57
+ optional: true,
58
+ verify_block: proc do |value|
59
+ valid_values = %w[success info warning error]
60
+ next if value.nil? || valid_values.include?(value)
61
+
62
+ UI.user_error!("Invalid value `#{value}` for parameter `style`. Valid values are: #{valid_values.join(', ')}")
63
+ end
64
+ ),
65
+ FastlaneCore::ConfigItem.new(
66
+ key: :message,
67
+ description: 'The message to use in the new annotation. Supports GFM-Flavored Markdown. ' \
68
+ + 'If message is nil, any existing annotation with the provided context will be deleted',
69
+ type: String,
70
+ optional: true,
71
+ default_value: nil # nil message = delete existing annotation if any
72
+ ),
73
+ ]
74
+ end
75
+
76
+ def self.authors
77
+ ['Automattic']
78
+ end
79
+
80
+ def self.is_supported?(platform)
81
+ true
82
+ end
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,67 @@
1
+ module Fastlane
2
+ module Actions
3
+ class BuildkiteMetadataAction < Action
4
+ def self.run(params)
5
+ # Set/Add new metadata values
6
+ params[:set]&.each do |key, value|
7
+ sh('buildkite-agent', 'meta-data', 'set', key.to_s, value.to_s)
8
+ end
9
+
10
+ # Return value of existing metadata key
11
+ sh('buildkite-agent', 'meta-data', 'get', params[:get].to_s) unless params[:get].nil?
12
+ end
13
+
14
+ #####################################################
15
+ # @!group Documentation
16
+ #####################################################
17
+
18
+ def self.description
19
+ 'Set/Get metadata to the current Buildkite build'
20
+ end
21
+
22
+ def self.details
23
+ <<~DETAILS
24
+ Set and/or get metadata to the current Buildkite build.
25
+
26
+ Has to be run on a CI job (where a `buildkite-agent` is running), e.g. typically by a lane
27
+ that is triggered as part of a Buildkite CI step.
28
+
29
+ See https://buildkite.com/docs/agent/v3/cli-meta-data
30
+ DETAILS
31
+ end
32
+
33
+ def self.available_options
34
+ [
35
+ FastlaneCore::ConfigItem.new(
36
+ key: :set,
37
+ env_name: 'BUILDKITE_METADATA_SET',
38
+ description: 'The hash of key/value pairs of the meta-data to set',
39
+ type: Hash,
40
+ optional: true,
41
+ default_value: nil
42
+ ),
43
+ FastlaneCore::ConfigItem.new(
44
+ key: :get,
45
+ env_name: 'BUILDKITE_METADATA_GET',
46
+ description: 'The key of the metadata to get the value of',
47
+ type: String,
48
+ optional: true,
49
+ default_value: nil
50
+ ),
51
+ ]
52
+ end
53
+
54
+ def self.return_value
55
+ 'The value of the Buildkite metadata corresponding to the provided `get` key. `nil` if no `get` parameter was provided.'
56
+ end
57
+
58
+ def self.authors
59
+ ['Automattic']
60
+ end
61
+
62
+ def self.is_supported?(platform)
63
+ true
64
+ end
65
+ end
66
+ end
67
+ end
@@ -13,7 +13,11 @@ module Fastlane
13
13
  branch: params[:branch],
14
14
  commit: params[:commit],
15
15
  env: params[:environment].merge(pipeline_name),
16
- message: params[:message]
16
+ message: params[:message],
17
+ # Buildkite will not trigger a build if the GitHub activity for that branch is turned off
18
+ # We want API triggers to work regardless of the GitHub activity settings, so this option is necessary
19
+ # https://forum.buildkite.community/t/request-build-error-branches-have-been-disabled-for-this-pipeline/1463/2
20
+ ignore_pipeline_branch_filters: true
17
21
  }.compact # remove entries with `nil` values from the Hash, if any
18
22
 
19
23
  client = Buildkit.new(token: params[:buildkite_token])
@@ -23,7 +27,11 @@ module Fastlane
23
27
  options
24
28
  )
25
29
 
26
- response.state == 'scheduled' ? UI.message('Done!') : UI.crash!("Failed to start job\nError: [#{response}]")
30
+ if response.state == 'scheduled'
31
+ UI.message("Successfully scheduled new build. You can see it at '#{response.web_url}'")
32
+ else
33
+ UI.crash!("Failed to start job\nError: [#{response}]")
34
+ end
27
35
  end
28
36
 
29
37
  #####################################################
@@ -44,12 +44,12 @@ module Fastlane
44
44
  UI.important <<~BREAKING_CHANGE_MESSAGE
45
45
  The latest version available (#{latest_version}) introduces breaking changes compared to the #{current_version} you are currently using.
46
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)
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
49
  to take those breaking changes into account.
50
50
 
51
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
52
+ non-breaking version by running `bundle update` now. This will not update to the latest #{latest_version}, but
53
53
  might still update to a newer version compatible with '#{current_semver_requirement}' if one exists; which is still valuable
54
54
  to at least get bugfixes, until you are ready to jump to the next major version later.
55
55
  BREAKING_CHANGE_MESSAGE
@@ -86,7 +86,7 @@ module Fastlane
86
86
  FastlaneCore::ConfigItem.new(key: :skip_update_suggestion,
87
87
  env_name: 'CHECK_FOR_TOOLKIT_UPDATES_SKIP_UPDATE_SUGGESTION',
88
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
89
+ type: Boolean,
90
90
  default_value: false),
91
91
  ]
92
92
  end
@@ -125,13 +125,13 @@ module Fastlane
125
125
  description: 'Should we abort with a global error if any violations are found?',
126
126
  optional: true,
127
127
  default_value: true,
128
- is_string: false),
128
+ type: Boolean),
129
129
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
130
130
  env_name: 'FL_CHECK_TRANSLATION_SKIP_CONFIRM',
131
131
  description: 'Move ahead without requesting confirmation if violations are found. Only works if "abort_on_violations" is disabled',
132
132
  optional: true,
133
133
  default_value: false,
134
- is_string: false),
134
+ type: Boolean),
135
135
  ]
136
136
  end
137
137
 
@@ -62,19 +62,19 @@ module Fastlane
62
62
  env_name: 'GHHELPER_NEED_APPSTORE_SUBMISSION',
63
63
  description: 'True if the app needs to be submitted',
64
64
  optional: true,
65
- is_string: false,
65
+ type: Boolean,
66
66
  default_value: false),
67
67
  FastlaneCore::ConfigItem.new(key: :milestone_duration,
68
68
  env_name: 'GHHELPER_MILESTONE_DURATION',
69
69
  description: 'Milestone duration in number of days',
70
70
  optional: true,
71
- is_string: false,
71
+ type: Integer,
72
72
  default_value: 14),
73
73
  FastlaneCore::ConfigItem.new(key: :number_of_days_from_code_freeze_to_release,
74
74
  env_name: 'GHHELPER_NUMBER_OF_DAYS_FROM_CODE_FREEZE_TO_RELEASE',
75
75
  description: 'Number of days from code freeze to release',
76
76
  optional: true,
77
- is_string: false,
77
+ type: Integer,
78
78
  default_value: 14),
79
79
  Fastlane::Helper::GithubHelper.github_token_config_item,
80
80
  ]
@@ -16,7 +16,7 @@ module Fastlane
16
16
  prerelease = params[:prerelease]
17
17
  is_draft = params[:is_draft]
18
18
 
19
- UI.message("Creating draft release #{version} in #{repository}.")
19
+ UI.message("Creating #{is_draft ? 'draft ' : ''}release #{version} in #{repository}.")
20
20
  # Verify assets
21
21
  assets.each do |file_path|
22
22
  UI.user_error!("Can't find file #{file_path}!") unless File.exist?(file_path)
@@ -84,7 +84,7 @@ module Fastlane
84
84
  description: 'True if this is a pre-release',
85
85
  optional: true,
86
86
  default_value: false,
87
- is_string: false),
87
+ type: Boolean),
88
88
  FastlaneCore::ConfigItem.new(key: :is_draft,
89
89
  env_name: 'GHHELPER_CREATE_RELEASE_IS_DRAFT',
90
90
  description: 'True to create the GitHub release as a draft (instead of publishing it immediately)',
@@ -67,17 +67,17 @@ module Fastlane
67
67
  env_name: 'GHHELPER_EXTRACT_NOTES_VERSION',
68
68
  description: 'The version of the release',
69
69
  optional: false,
70
- is_string: true),
70
+ type: String),
71
71
  FastlaneCore::ConfigItem.new(key: :release_notes_file_path,
72
72
  env_name: 'GHHELPER_EXTRACT_NOTES_FILE_PATH',
73
73
  description: 'The path to the file that contains the release notes',
74
74
  optional: false,
75
- is_string: true),
75
+ type: String),
76
76
  FastlaneCore::ConfigItem.new(key: :extracted_notes_file_path,
77
77
  env_name: 'GHHELPER_EXTRACT_NOTES_EXTRACTED_FILE_PATH',
78
78
  description: 'The path to the file that will contain the extracted release notes',
79
79
  optional: true,
80
- is_string: true),
80
+ type: String),
81
81
  ]
82
82
  end
83
83
 
@@ -49,11 +49,11 @@ module Fastlane
49
49
  FastlaneCore::ConfigItem.new(key: :report_path,
50
50
  description: 'The path where the list of PRs should be written to',
51
51
  optional: false,
52
- is_string: true),
52
+ type: String),
53
53
  FastlaneCore::ConfigItem.new(key: :milestone,
54
54
  description: 'The name of the milestone we want to fetch the list of PRs for (e.g.: `16.9`)',
55
55
  optional: false,
56
- is_string: true),
56
+ type: String),
57
57
  Fastlane::Helper::GithubHelper.github_token_config_item,
58
58
  ]
59
59
  end
@@ -12,7 +12,7 @@ module Fastlane
12
12
  UI.message "Path: #{params[:download_path]}"
13
13
 
14
14
  # Check download path
15
- Dir.mkdir(params[:download_path]) unless File.exist?(params[:download_path])
15
+ FileUtils.mkdir_p(params[:download_path])
16
16
 
17
17
  # Download
18
18
  downloader = Fastlane::Helper::MetadataDownloader.new(params[:download_path], params[:target_files])
@@ -55,11 +55,11 @@ module Fastlane
55
55
  FastlaneCore::ConfigItem.new(key: :target_files,
56
56
  env_name: 'FL_DOWNLOAD_METADATA_TARGET_FILES',
57
57
  description: 'The hash with the path to the target files and the key to use to extract their content',
58
- is_string: false),
58
+ type: Hash),
59
59
  FastlaneCore::ConfigItem.new(key: :locales,
60
60
  env_name: 'FL_DOWNLOAD_METADATA_LOCALES',
61
61
  description: 'The hash with the GlotPress locale and the project locale association',
62
- is_string: false),
62
+ type: Hash),
63
63
  FastlaneCore::ConfigItem.new(key: :source_locale,
64
64
  env_name: 'FL_DOWNLOAD_METADATA_SOURCE_LOCALE',
65
65
  description: 'The source locale code',
@@ -67,7 +67,7 @@ module Fastlane
67
67
  FastlaneCore::ConfigItem.new(key: :download_path,
68
68
  env_name: 'FL_DOWNLOAD_METADATA_DOWNLOAD_PATH',
69
69
  description: 'The path of the target files',
70
- is_string: true),
70
+ type: String),
71
71
  ]
72
72
  end
73
73