fastlane-plugin-wpmreleasetoolkit 5.0.0 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe6a0ccccfa972725f15898f4d1894e9ce81a8ee60b27c436d1930cd68b58a59
4
- data.tar.gz: 7c25d05bd642b368cfe8eac93bb7e26db77dd8380f4665a2521b9b7c0191d7d5
3
+ metadata.gz: 3a29c8bfbf5d7754cf59109a7dcf521efc91fab3b4314027db41f08a95390c7b
4
+ data.tar.gz: c4abdb17c40e79e17ce13a630ac9496768364b479a2496aa26fd9e4c633cae0c
5
5
  SHA512:
6
- metadata.gz: 7dd36004e4d5f45cb747bd5d005937deb36cf8a638aa556460e059dbbae823fac182bd1f6af849972c053ecef91e2e57c6bbf64d771014f973b07a0502f6897d
7
- data.tar.gz: 9d719a9f9ca3281d6a5d6045040782df58552966f91a3042edaaaf0e98e4fcd9c3a7a2758fdb2af550d5bf3dd8ce0a4c3af92c6b367ca054b1d11971d8cc6275
6
+ metadata.gz: d1050f9832b07111a7a8c1740e3ec95c2d59372449b84d901d8ec97f01f1f2ab47abf1383f743569f77666f04d76440e4d167a5d02b1e457da788b67ff8088a8
7
+ data.tar.gz: 8986d9c68fd931d1a384f8735b9d661bd7523fef0b88d18d0371379a61bbc3f25b6ede7b287d2b2b89dc6e2a315121a80324aacd1b127c64bdd996bc8e203fd8
data/README.md CHANGED
@@ -20,6 +20,21 @@ Read our [Contributing Guide](CONTRIBUTING.md) to learn about reporting issues,
20
20
 
21
21
  This guide also includes some tips about configuring your environment and IDE (e.g. VSCode) and how to run tests and documentation.
22
22
 
23
+ ## Doing a new Release
24
+
25
+ When you need to do a new release of the `release-toolkit`, simply run `rake new_release` and follow the instructions.
26
+
27
+ > This task will:
28
+ > - Show you the CHANGELOG/release notes it's about to use for that version
29
+ > - Deduce which version number to use according to [SemVer](https://semver.org/) rules, and ask you to confirm that version number
30
+ > - Create a `release/<x.y>` branch, update the version number in all the right places, and create a PR for those changes
31
+
32
+ Submit the PR, adding the `Releases` label to it and adding the `owl-team` as reviewers.
33
+
34
+ Once that PR is approved and merged, create a new GitHub Release, copy/pasting the CHANGELOG entries for that GH release's description.
35
+
36
+ > Publishing the GitHub Release will create the associated tag as well, which will trigger the CI job that will ultimately `gem push` the gem on RubyGems.
37
+
23
38
  ## Security
24
39
 
25
40
  If you happen to find a security vulnerability, we would appreciate you letting us know at https://hackerone.com/automattic and allowing us to respond before disclosing the issue publicly.
@@ -8,7 +8,7 @@ module Fastlane
8
8
  require_relative '../../helper/release_notes_helper'
9
9
  require_relative '../../helper/git_helper'
10
10
 
11
- path = File.join(ENV['PROJECT_ROOT_FOLDER'] || '.', 'RELEASE-NOTES.txt')
11
+ path = params[:release_notes_file_path]
12
12
  next_version = Fastlane::Helper::Android::VersionHelper.calc_next_release_short_version(params[:new_version])
13
13
 
14
14
  Fastlane::Helper::ReleaseNotesHelper.add_new_section(path: path, section_title: next_version)
@@ -35,6 +35,11 @@ module Fastlane
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
37
  is_string: true),
38
+ FastlaneCore::ConfigItem.new(key: :release_notes_file_path,
39
+ env_name: 'FL_ANDROID_UPDATE_RELEASE_NOTES_FILE_PATH',
40
+ description: 'The path to the release notes file to be updated',
41
+ is_string: true,
42
+ default_value: File.join(ENV['PROJECT_ROOT_FOLDER'] || '.', 'RELEASE-NOTES.txt')),
38
43
  ]
39
44
  end
40
45
 
@@ -9,16 +9,18 @@ module Fastlane
9
9
  pipeline_name = {
10
10
  PIPELINE: params[:pipeline_file]
11
11
  }
12
+ options = {
13
+ branch: params[:branch],
14
+ commit: params[:commit],
15
+ env: params[:environment].merge(pipeline_name),
16
+ message: params[:message]
17
+ }.compact # remove entries with `nil` values from the Hash, if any
12
18
 
13
19
  client = Buildkit.new(token: params[:buildkite_token])
14
20
  response = client.create_build(
15
21
  params[:buildkite_organization],
16
22
  params[:buildkite_pipeline],
17
- {
18
- branch: params[:branch],
19
- commit: params[:commit],
20
- env: params[:environment].merge(pipeline_name)
21
- }
23
+ options
22
24
  )
23
25
 
24
26
  response.state == 'scheduled' ? UI.message('Done!') : UI.crash!("Failed to start job\nError: [#{response}]")
@@ -36,7 +38,7 @@ module Fastlane
36
38
  [
37
39
  FastlaneCore::ConfigItem.new(
38
40
  key: :buildkite_token,
39
- env_name: 'BUILDKITE_TOKEN',
41
+ env_names: %w[BUILDKITE_TOKEN BUILDKITE_API_TOKEN],
40
42
  description: 'Buildkite Personal Access Token',
41
43
  type: String,
42
44
  sensitive: true
@@ -64,6 +66,13 @@ module Fastlane
64
66
  type: String,
65
67
  default_value: 'HEAD'
66
68
  ),
69
+ FastlaneCore::ConfigItem.new(
70
+ key: :message,
71
+ description: 'A custom message to show for the build in Buildkite\'s UI',
72
+ type: String,
73
+ optional: true,
74
+ default_value: nil
75
+ ),
67
76
  FastlaneCore::ConfigItem.new(
68
77
  key: :pipeline_file,
69
78
  description: 'The name of the pipeline file in the project',
@@ -12,10 +12,12 @@ module Fastlane
12
12
  last_stone = Fastlane::Helper::GithubHelper.get_last_milestone(repository)
13
13
  UI.message("Last detected milestone: #{last_stone[:title]} due on #{last_stone[:due_on]}.")
14
14
  milestone_duedate = last_stone[:due_on]
15
- newmilestone_duedate = (milestone_duedate.to_datetime.next_day(14).to_time).utc
15
+ milestone_duration = params[:milestone_duration]
16
+ newmilestone_duedate = (milestone_duedate.to_datetime.next_day(milestone_duration).to_time).utc
16
17
  newmilestone_number = Fastlane::Helper::Ios::VersionHelper.calc_next_release_version(last_stone[:title])
18
+ number_of_days_from_code_freeze_to_release = params[:number_of_days_from_code_freeze_to_release]
17
19
  UI.message("Next milestone: #{newmilestone_number} due on #{newmilestone_duedate}.")
18
- Fastlane::Helper::GithubHelper.create_milestone(repository, newmilestone_number, newmilestone_duedate, params[:need_appstore_submission])
20
+ Fastlane::Helper::GithubHelper.create_milestone(repository, newmilestone_number, newmilestone_duedate, milestone_duration, number_of_days_from_code_freeze_to_release, params[:need_appstore_submission])
19
21
  end
20
22
 
21
23
  def self.description
@@ -48,6 +50,18 @@ module Fastlane
48
50
  optional: true,
49
51
  is_string: false,
50
52
  default_value: false),
53
+ FastlaneCore::ConfigItem.new(key: :milestone_duration,
54
+ env_name: 'GHHELPER_MILESTONE_DURATION',
55
+ description: 'Milestone duration in number of days',
56
+ optional: true,
57
+ is_string: false,
58
+ default_value: 14),
59
+ FastlaneCore::ConfigItem.new(key: :number_of_days_from_code_freeze_to_release,
60
+ env_name: 'GHHELPER_NUMBER_OF_DAYS_FROM_CODE_FREEZE_TO_RELEASE',
61
+ description: 'Number of days from code freeze to release',
62
+ optional: true,
63
+ is_string: false,
64
+ default_value: 14),
51
65
  ]
52
66
  end
53
67
 
@@ -8,7 +8,7 @@ module Fastlane
8
8
  require_relative '../../helper/release_notes_helper'
9
9
  require_relative '../../helper/git_helper'
10
10
 
11
- path = File.join(ENV['PROJECT_ROOT_FOLDER'] || '.', 'RELEASE-NOTES.txt')
11
+ path = params[:release_notes_file_path]
12
12
  next_version = Fastlane::Helper::Ios::VersionHelper.calc_next_release_version(params[:new_version])
13
13
 
14
14
  Fastlane::Helper::ReleaseNotesHelper.add_new_section(path: path, section_title: next_version)
@@ -35,6 +35,11 @@ module Fastlane
35
35
  env_name: 'FL_IOS_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
37
  is_string: true),
38
+ FastlaneCore::ConfigItem.new(key: :release_notes_file_path,
39
+ env_name: 'FL_IOS_UPDATE_RELEASE_NOTES_FILE_PATH',
40
+ description: 'The path to the release notes file to be updated',
41
+ is_string: true,
42
+ default_value: File.join(ENV['PROJECT_ROOT_FOLDER'] || '.', 'RELEASE-NOTES.txt')),
38
43
  ]
39
44
  end
40
45
 
@@ -212,8 +212,8 @@ module Fastlane
212
212
  def self.create_available_languages_file(res_dir:, locale_codes:)
213
213
  doc = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
214
214
  xml.comment('Warning: Auto-generated file, do not edit.')
215
- xml.resources do
216
- xml.send(:'string-array', name: 'available_languages', translatable: 'false') do
215
+ xml.resources('xmlns:tools': 'http://schemas.android.com/tools') do
216
+ xml.send(:'string-array', name: 'available_languages', translatable: 'false', 'tools:ignore': 'InconsistentArrays') do
217
217
  locale_codes.each { |code| xml.item(code.gsub('-r', '_')) }
218
218
  end
219
219
  end
@@ -70,7 +70,7 @@ module Fastlane
70
70
  else
71
71
  begin
72
72
  last_vcomps = last_stone[:title].split[0].split('.')
73
- last_stone = mile if mile_vcomps[0] > last_vcomps[0] || mile_vcomps[1] > last_vcomps[1]
73
+ last_stone = mile if Integer(mile_vcomps[0]) > Integer(last_vcomps[0]) || Integer(mile_vcomps[1]) > Integer(last_vcomps[1])
74
74
  rescue StandardError
75
75
  puts 'Found invalid milestone'
76
76
  end
@@ -80,9 +80,13 @@ module Fastlane
80
80
  last_stone
81
81
  end
82
82
 
83
- def self.create_milestone(repository, newmilestone_number, newmilestone_duedate, need_submission)
84
- submission_date = need_submission ? newmilestone_duedate.to_datetime.next_day(11) : newmilestone_duedate.to_datetime.next_day(14)
85
- release_date = newmilestone_duedate.to_datetime.next_day(14)
83
+ def self.create_milestone(repository, newmilestone_number, newmilestone_duedate, newmilestone_duration, number_of_days_from_code_freeze_to_release, need_submission)
84
+ # If there is a review process, we want to submit the binary 3 days before its release
85
+ #
86
+ # Using 3 days is mostly for historical reasons where we release the apps on Monday and submit them on Friday.
87
+ days_until_submission = need_submission ? (number_of_days_from_code_freeze_to_release - 3) : newmilestone_duration
88
+ submission_date = newmilestone_duedate.to_datetime.next_day(days_until_submission)
89
+ release_date = newmilestone_duedate.to_datetime.next_day(number_of_days_from_code_freeze_to_release)
86
90
  comment = "Code freeze: #{newmilestone_duedate.to_datetime.strftime('%B %d, %Y')} App Store submission: #{submission_date.strftime('%B %d, %Y')} Release: #{release_date.strftime('%B %d, %Y')}"
87
91
 
88
92
  options = {}
@@ -40,7 +40,7 @@ module Fastlane
40
40
  target_files.each do |file|
41
41
  if file[0].to_s == key
42
42
  data = file[1]
43
- msg = is_source ? source : d[1]
43
+ msg = is_source ? source : d[1].first || '' # In the JSON, each Hash value is an array, with zero or one entry
44
44
  update_key(target_locale, key, file, data, msg)
45
45
  end
46
46
  end
@@ -58,7 +58,7 @@ module Fastlane
58
58
  if file[0].to_s == key
59
59
  puts "Alternate: #{key}"
60
60
  data = file[1]
61
- msg = is_source ? source : d[1]
61
+ msg = is_source ? source : d[1].first || '' # In the JSON, each Hash value is an array, with zero or one entry
62
62
  update_key(target_locale, key, file, data, msg)
63
63
  end
64
64
  end
@@ -66,7 +66,7 @@ module Fastlane
66
66
  end
67
67
 
68
68
  def update_key(target_locale, key, file, data, msg)
69
- message_len = msg.to_s.length - 4 # Don't count JSON delimiters.
69
+ message_len = msg.length
70
70
  if (data.key?(:max_size)) && (data[:max_size] != 0) && ((message_len) > data[:max_size])
71
71
  if data.key?(:alternate_key)
72
72
  UI.message("#{target_locale} translation for #{key} exceeds maximum length (#{message_len}). Switching to the alternate translation.")
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Wpmreleasetoolkit
3
- VERSION = '5.0.0'
3
+ VERSION = '5.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-wpmreleasetoolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Automattic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-18 00:00:00.000000000 Z
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport