fastlane-plugin-wpmreleasetoolkit 5.1.0 → 5.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_firebase_test.rb +8 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb +6 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_trigger_build_action.rb +14 -5
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb +16 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb +6 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb +3 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +8 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_helper.rb +1 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_test_runner.rb +11 -10
- data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab2ce164571f692b1378b62adade73faab9e319127ecd08b86a131a490d5185d
|
4
|
+
data.tar.gz: 3a0eb54e84aeeb1df3d71f5e7d91c586c3427c7055545fd28bc3b7a2cfcdb9cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab32b891a6e254a1406241624dd6117e233ebe541f40b405d614d2cb827e73f904b71afe9e1d1c8cf6f067c1285b05bb452d4137af7b8886ee20793e67e243c7
|
7
|
+
data.tar.gz: b61749dedc931a5e58cbf3357f6c24fcdf01e5a704648d9b082f51b4ce44b5f0b11457ce593efe684bb2c88eebfcbf70164de13bda199bcc1f988b3dbfbe825e
|
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.
|
@@ -33,6 +33,7 @@ module Fastlane
|
|
33
33
|
apk_path: params[:apk_path],
|
34
34
|
test_apk_path: params[:test_apk_path],
|
35
35
|
device: device,
|
36
|
+
test_targets: params[:test_targets],
|
36
37
|
type: params[:type]
|
37
38
|
)
|
38
39
|
|
@@ -106,6 +107,13 @@ module Fastlane
|
|
106
107
|
UI.user_error!("Invalid test APK: #{value}") unless File.exist?(value)
|
107
108
|
end
|
108
109
|
),
|
110
|
+
FastlaneCore::ConfigItem.new(
|
111
|
+
key: :test_targets,
|
112
|
+
description: 'A list of one or more test target filters to apply',
|
113
|
+
type: String,
|
114
|
+
optional: true,
|
115
|
+
default_value: nil
|
116
|
+
),
|
109
117
|
FastlaneCore::ConfigItem.new(
|
110
118
|
key: :model,
|
111
119
|
description: 'The device model to use to run the test',
|
@@ -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 =
|
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}]")
|
@@ -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
|
-
|
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
|
|
@@ -58,7 +58,7 @@ module Fastlane
|
|
58
58
|
|
59
59
|
def self.details
|
60
60
|
# Optional:
|
61
|
-
'
|
61
|
+
'Given a file containing release notes and a version, extracts the notes for that version into a dedicated file.'
|
62
62
|
end
|
63
63
|
|
64
64
|
def self.available_options
|
@@ -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 =
|
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
|
@@ -291,6 +291,7 @@ module Fastlane
|
|
291
291
|
uri.open(options) { |f| Nokogiri::XML(f.read.gsub("\t", ' '), nil, Encoding::UTF_8.to_s) }
|
292
292
|
rescue StandardError => e
|
293
293
|
UI.error "Error downloading #{locale} - #{e.message}"
|
294
|
+
retry if e.is_a?(OpenURI::HTTPError) && UI.confirm("Retry downloading `#{locale}`?")
|
294
295
|
return nil
|
295
296
|
end
|
296
297
|
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
|
-
|
85
|
-
|
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 = {}
|
@@ -152,6 +152,7 @@ module Fastlane
|
|
152
152
|
IO.copy_stream(uri.open(options), destination)
|
153
153
|
rescue StandardError => e
|
154
154
|
UI.error "Error downloading locale `#{locale}` — #{e.message} (#{uri})"
|
155
|
+
retry if e.is_a?(OpenURI::HTTPError) && UI.confirm("Retry downloading `#{locale}`?")
|
155
156
|
return nil
|
156
157
|
end
|
157
158
|
end
|
@@ -20,20 +20,21 @@ module Fastlane
|
|
20
20
|
# @param [FirebaseDevice] device The virtual device to run tests on.
|
21
21
|
# @param [String] type The type of test to run.
|
22
22
|
#
|
23
|
-
def self.run_tests(project_id:, apk_path:, test_apk_path:, device:, type: 'instrumentation')
|
23
|
+
def self.run_tests(project_id:, apk_path:, test_apk_path:, device:, test_targets: nil, type: 'instrumentation')
|
24
24
|
raise "Unable to find apk: #{apk_path}" unless File.file?(apk_path)
|
25
25
|
raise "Unable to find apk: #{test_apk_path}" unless File.file?(test_apk_path)
|
26
26
|
raise "Invalid Type: #{type}" unless VALID_TEST_TYPES.include?(type)
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
'
|
34
|
-
|
35
|
-
|
36
|
-
]
|
28
|
+
params = {
|
29
|
+
project: project_id,
|
30
|
+
type: type,
|
31
|
+
app: apk_path,
|
32
|
+
test: test_apk_path,
|
33
|
+
'test-targets': test_targets,
|
34
|
+
device: device.to_s,
|
35
|
+
verbosity: 'info'
|
36
|
+
}.compact.flat_map { |k, v| ["--#{k}", v] }
|
37
|
+
command = Shellwords.join(['gcloud', 'firebase', 'test', 'android', 'run', *params])
|
37
38
|
|
38
39
|
log_file_path = Fastlane::Actions.lane_context[:FIREBASE_TEST_LOG_FILE_PATH]
|
39
40
|
|
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.
|
4
|
+
version: 5.4.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-
|
11
|
+
date: 2022-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|