fastlane-plugin-wpmreleasetoolkit 8.1.0 → 9.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb +6 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_validate_lib_strings_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_final_release.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +3 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +3 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +4 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_file_by_version.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_firebase_test.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_hotfix_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_trigger_build_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb +4 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb +3 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/find_previous_tag.rb +58 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_between_tags.rb +112 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb +5 -5
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb +6 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb +24 -24
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/upload_to_s3.rb +37 -5
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb +3 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb +3 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_validate_action.rb +3 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_development_certificates_to_provisioning_profiles.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb +4 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb +5 -7
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +3 -22
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb +6 -20
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_app_version.rb +11 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_hotfix_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_tag_build.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb +4 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_validate_ci_build.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb +39 -41
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +10 -11
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/configure_helper.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +39 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_adc_app_sizes_helper.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_git_helper.rb +2 -55
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb +3 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb +42 -52
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/metadata_block.rb +20 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/release_note_metadata_block.rb +72 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/release_note_short_metadata_block.rb +23 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/standard_metadata_block.rb +47 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/unknown_metadata_block.rb +13 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/whats_new_metadata_block.rb +53 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb +13 -13
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb +11 -11
- data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +3 -1
- metadata +32 -15
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_list_action.rb +0 -66
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_localize_project.rb +0 -43
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata.rb +0 -40
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/an_metadata_update_helper.rb +0 -152
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_update_helper.rb +0 -182
@@ -22,18 +22,25 @@ module Fastlane
|
|
22
22
|
|
23
23
|
if file_is_already_uploaded?(bucket, key)
|
24
24
|
message = "File already exists in S3 bucket #{bucket} at #{key}"
|
25
|
-
|
25
|
+
|
26
|
+
# skip_if_exists is deprecated but we want to keep backward compatibility.
|
27
|
+
params[:if_exists] ||= params[:skip_if_exists] ? :skip : :fail
|
28
|
+
|
29
|
+
case params[:if_exists]
|
30
|
+
when :fail
|
31
|
+
UI.user_error!(message)
|
32
|
+
when :replace
|
33
|
+
UI.important("#{message}. Will replace with the given one.")
|
34
|
+
when :skip
|
26
35
|
UI.important("#{message}. Skipping upload.")
|
27
36
|
return key
|
28
|
-
else
|
29
|
-
UI.user_error!(message)
|
30
37
|
end
|
31
38
|
end
|
32
39
|
|
33
40
|
UI.message("Uploading #{file_path} to: #{key}")
|
34
41
|
|
35
42
|
File.open(file_path, 'rb') do |file|
|
36
|
-
Aws::S3::Client.new
|
43
|
+
Aws::S3::Client.new.put_object(
|
37
44
|
body: file,
|
38
45
|
bucket: bucket,
|
39
46
|
key: key
|
@@ -50,7 +57,7 @@ module Fastlane
|
|
50
57
|
end
|
51
58
|
|
52
59
|
def self.file_is_already_uploaded?(bucket, key)
|
53
|
-
response = Aws::S3::Client.new
|
60
|
+
response = Aws::S3::Client.new.head_object(
|
54
61
|
bucket: bucket,
|
55
62
|
key: key
|
56
63
|
)
|
@@ -112,10 +119,35 @@ module Fastlane
|
|
112
119
|
FastlaneCore::ConfigItem.new(
|
113
120
|
key: :skip_if_exists,
|
114
121
|
description: 'If the file already exists in the S3 bucket, skip the upload (and report it in the logs), instead of failing with `user_error!`',
|
122
|
+
deprecated: 'Use if_exists instead',
|
123
|
+
conflicting_options: [:if_exists],
|
124
|
+
conflict_block: proc do |option|
|
125
|
+
UI.user_error!("You cannot set both :#{option.key} and :skip_if_exists. Please only use :if_exists.")
|
126
|
+
end,
|
115
127
|
optional: true,
|
128
|
+
# This option is deprecated but we stil set a default value to inform that the default behavior is for the action to fail when printing the action docs.
|
129
|
+
# See also https://github.com/wordpress-mobile/release-toolkit/pull/500#discussion_r1239642179
|
116
130
|
default_value: false,
|
117
131
|
type: Boolean
|
118
132
|
),
|
133
|
+
FastlaneCore::ConfigItem.new(
|
134
|
+
key: :if_exists,
|
135
|
+
description: 'What do to if the file file already exists in the S3 bucket. Possible values :skip, :replace, :fail. When set, overrides the deprecated skip_if_exists option',
|
136
|
+
conflicting_options: [:skip_if_exists],
|
137
|
+
conflict_block: proc do |option|
|
138
|
+
UI.user_error!("You cannot set both :#{option.key} and :if_exists. Please only use :if_exists.")
|
139
|
+
end,
|
140
|
+
optional: true,
|
141
|
+
type: Symbol,
|
142
|
+
# We cannot set a default value and have backward compatibility with skip_if_exists at the same time.
|
143
|
+
# (Short of duplicating the default value knowledge in the action implementation)
|
144
|
+
#
|
145
|
+
# We have a test for the default behavior which should hopefully remind us to uncomment this line once well remove skip_if_exists.
|
146
|
+
# default_value: :fail,
|
147
|
+
verify_block: proc do |value|
|
148
|
+
UI.user_error!('`if_exist` must be one of :skip, :replace, :fail') unless %i[skip replace fail].include?(value)
|
149
|
+
end
|
150
|
+
),
|
119
151
|
]
|
120
152
|
end
|
121
153
|
|
data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb
CHANGED
@@ -40,13 +40,13 @@ module Fastlane
|
|
40
40
|
UI.message 'Example: google-services.json'
|
41
41
|
|
42
42
|
source = UI.input('Source File Path:')
|
43
|
-
|
43
|
+
source_path = absolute_secret_store_path(source) # Transform the relative path into an absolute path.
|
44
44
|
|
45
45
|
# Don't allow the developer to accidentally specify an invalid file, otherwise validation will never succeed.
|
46
|
-
if File.file?(
|
46
|
+
if File.file?(source_path)
|
47
47
|
invalid_file = false
|
48
48
|
else
|
49
|
-
UI.error "There is no file at #{
|
49
|
+
UI.error "There is no file at #{source_path}."
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -9,10 +9,10 @@ module Fastlane
|
|
9
9
|
UI.message 'Running Configure Download'
|
10
10
|
|
11
11
|
# If the `~/.mobile-secrets` repository doesn't exist
|
12
|
-
|
13
|
-
UI.user_error!("The local secrets store does not exist. Please clone it to #{secrets_dir} before continuing.")
|
14
|
-
else
|
12
|
+
if File.directory?(secrets_dir)
|
15
13
|
update_repository # If the repo already exists, just update it
|
14
|
+
else
|
15
|
+
UI.user_error!("The local secrets store does not exist. Please clone it to #{secrets_dir} before continuing.")
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -50,8 +50,8 @@ module Fastlane
|
|
50
50
|
new_branch = UI.select("Select the branch you'd like to switch to: ", get_branches)
|
51
51
|
checkout_branch(new_branch)
|
52
52
|
update_configure_file
|
53
|
-
|
54
|
-
UI.user_error!('The local secrets store is in a deatched HEAD state. Please check out a branch and try again.')
|
53
|
+
elsif current_branch.nil?
|
54
|
+
UI.user_error!('The local secrets store is in a deatched HEAD state. Please check out a branch and try again.')
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -91,10 +91,10 @@ module Fastlane
|
|
91
91
|
source = absolute_secret_store_path(x.file)
|
92
92
|
destination = absolute_project_path(x.destination)
|
93
93
|
|
94
|
-
|
95
|
-
|
94
|
+
source_hash = file_hash(source)
|
95
|
+
destination_hash = file_hash(destination)
|
96
96
|
|
97
|
-
UI.user_error!("`#{x.destination} doesn't match the file in the secrets repository (#{x.file}) – unable to continue") unless
|
97
|
+
UI.user_error!("`#{x.destination} doesn't match the file in the secrets repository (#{x.file}) – unable to continue") unless source_hash == destination_hash
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
@@ -17,7 +17,7 @@ module Fastlane
|
|
17
17
|
profile.is_a? Spaceship::Portal::ProvisioningProfile::Development
|
18
18
|
end
|
19
19
|
.tap do |profiles|
|
20
|
-
UI.important "Warning: Unable to find any profiles associated with #{identifier}"
|
20
|
+
UI.important "Warning: Unable to find any profiles associated with #{identifier}" if profiles.empty?
|
21
21
|
end
|
22
22
|
.each do |profile|
|
23
23
|
profile.certificates = all_certificates
|
@@ -51,7 +51,7 @@ module Fastlane
|
|
51
51
|
description: 'The team_id for the provisioning profiles',
|
52
52
|
type: String,
|
53
53
|
verify_block: proc do |value|
|
54
|
-
UI.user_error!('You must provide a team ID in `team_id`') unless value &&
|
54
|
+
UI.user_error!('You must provide a team ID in `team_id`') unless value && !value.empty?
|
55
55
|
end),
|
56
56
|
]
|
57
57
|
end
|
data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb
CHANGED
@@ -15,7 +15,7 @@ module Fastlane
|
|
15
15
|
profile.is_a? Spaceship::Portal::ProvisioningProfile::Development
|
16
16
|
end
|
17
17
|
.tap do |profiles|
|
18
|
-
UI.important "Warning: Unable to find any profiles associated with #{identifier}"
|
18
|
+
UI.important "Warning: Unable to find any profiles associated with #{identifier}" if profiles.empty?
|
19
19
|
end
|
20
20
|
.each do |profile|
|
21
21
|
profile.devices = devices
|
@@ -52,7 +52,7 @@ module Fastlane
|
|
52
52
|
description: 'The team_id for the provisioning profiles',
|
53
53
|
type: String,
|
54
54
|
verify_block: proc do |value|
|
55
|
-
UI.user_error!('You must provide a team ID in `team_id`') unless value &&
|
55
|
+
UI.user_error!('You must provide a team ID in `team_id`') unless value && !value.empty?
|
56
56
|
end
|
57
57
|
),
|
58
58
|
]
|
@@ -5,9 +5,9 @@ module Fastlane
|
|
5
5
|
require_relative '../../helper/ios/ios_version_helper'
|
6
6
|
|
7
7
|
message = ''
|
8
|
-
message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_internal_version
|
9
|
-
message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_build_version
|
10
|
-
message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_build_version
|
8
|
+
message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_internal_version} and uploading to App Center\n" if params[:internal]
|
9
|
+
message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_build_version} and uploading to App Center\n" if params[:internal_on_single_version]
|
10
|
+
message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_build_version} and uploading to TestFlight\n" if params[:external]
|
11
11
|
|
12
12
|
if params[:skip_confirm]
|
13
13
|
UI.message(message)
|
@@ -16,7 +16,7 @@ module Fastlane
|
|
16
16
|
end
|
17
17
|
|
18
18
|
# Check local repo status
|
19
|
-
other_action.ensure_git_status_clean
|
19
|
+
other_action.ensure_git_status_clean unless other_action.is_ci
|
20
20
|
end
|
21
21
|
|
22
22
|
#####################################################
|
@@ -8,14 +8,14 @@ module Fastlane
|
|
8
8
|
require_relative '../../helper/ios/ios_version_helper'
|
9
9
|
|
10
10
|
Fastlane::Helper::GitHelper.ensure_on_branch!('release')
|
11
|
-
create_config
|
12
|
-
show_config
|
11
|
+
create_config
|
12
|
+
show_config
|
13
13
|
|
14
14
|
UI.message 'Updating XcConfig...'
|
15
15
|
Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_beta_version, @short_version, @new_internal_version)
|
16
16
|
UI.message 'Done!'
|
17
17
|
|
18
|
-
Fastlane::Helper::Ios::GitHelper.commit_version_bump
|
18
|
+
Fastlane::Helper::Ios::GitHelper.commit_version_bump
|
19
19
|
end
|
20
20
|
|
21
21
|
#####################################################
|
@@ -47,11 +47,9 @@ module Fastlane
|
|
47
47
|
[:ios, :mac].include?(platform)
|
48
48
|
end
|
49
49
|
|
50
|
-
private
|
51
|
-
|
52
50
|
def self.create_config
|
53
|
-
@current_version = Fastlane::Helper::Ios::VersionHelper.get_build_version
|
54
|
-
@current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version
|
51
|
+
@current_version = Fastlane::Helper::Ios::VersionHelper.get_build_version
|
52
|
+
@current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version unless ENV['INTERNAL_CONFIG_FILE'].nil?
|
55
53
|
@new_internal_version = Fastlane::Helper::Ios::VersionHelper.create_internal_version(@current_version) unless ENV['INTERNAL_CONFIG_FILE'].nil?
|
56
54
|
@new_beta_version = Fastlane::Helper::Ios::VersionHelper.calc_next_build_version(@current_version)
|
57
55
|
@short_version = Fastlane::Helper::Ios::VersionHelper.get_short_version_string(@new_beta_version)
|
@@ -7,20 +7,13 @@ module Fastlane
|
|
7
7
|
require_relative '../../helper/ios/ios_git_helper'
|
8
8
|
Fastlane::Helper::GitHelper.create_branch("release/#{params[:version]}", from: params[:previous_version])
|
9
9
|
create_config(params[:previous_version], params[:version])
|
10
|
-
show_config
|
11
|
-
|
12
|
-
update_deliverfile = params[:skip_deliver] == false
|
13
|
-
if update_deliverfile
|
14
|
-
UI.message 'Updating Fastlane deliver file...'
|
15
|
-
Fastlane::Helper::Ios::VersionHelper.update_fastlane_deliver(@new_short_version)
|
16
|
-
UI.message 'Done!'
|
17
|
-
end
|
10
|
+
show_config
|
18
11
|
|
19
12
|
UI.message 'Updating XcConfig...'
|
20
13
|
Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_version, @new_short_version, @new_version_internal)
|
21
14
|
UI.message 'Done!'
|
22
15
|
|
23
|
-
Fastlane::Helper::Ios::GitHelper.commit_version_bump
|
16
|
+
Fastlane::Helper::Ios::GitHelper.commit_version_bump
|
24
17
|
|
25
18
|
UI.message 'Done.'
|
26
19
|
end
|
@@ -51,16 +44,6 @@ module Fastlane
|
|
51
44
|
description: 'The version to branch from',
|
52
45
|
type: String
|
53
46
|
),
|
54
|
-
FastlaneCore::ConfigItem.new(
|
55
|
-
key: :skip_deliver,
|
56
|
-
env_name: 'FL_IOS_BUMP_VERSION_HOTFIX_SKIP_DELIVER',
|
57
|
-
description: 'Skips Deliverfile key update',
|
58
|
-
type: Boolean,
|
59
|
-
optional: true,
|
60
|
-
# Don't skip the Deliverfile by default. At the time of writing, 2 out of 3 consumers
|
61
|
-
# still have a Deliverfile.
|
62
|
-
default_value: false
|
63
|
-
),
|
64
47
|
]
|
65
48
|
end
|
66
49
|
|
@@ -78,11 +61,9 @@ module Fastlane
|
|
78
61
|
[:ios, :mac].include?(platform)
|
79
62
|
end
|
80
63
|
|
81
|
-
private
|
82
|
-
|
83
64
|
def self.create_config(previous_version, new_short_version)
|
84
65
|
@current_version = previous_version
|
85
|
-
@current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version
|
66
|
+
@current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version unless ENV['INTERNAL_CONFIG_FILE'].nil?
|
86
67
|
@new_version = "#{new_short_version}.0"
|
87
68
|
@new_version_internal = Fastlane::Helper::Ios::VersionHelper.create_internal_version(@new_version) unless ENV['INTERNAL_CONFIG_FILE'].nil?
|
88
69
|
@new_short_version = new_short_version
|
@@ -12,27 +12,20 @@ module Fastlane
|
|
12
12
|
other_action.ensure_git_branch(branch: default_branch)
|
13
13
|
|
14
14
|
# Create new configuration
|
15
|
-
@new_version = Fastlane::Helper::Ios::VersionHelper.bump_version_release
|
16
|
-
create_config
|
17
|
-
show_config
|
15
|
+
@new_version = Fastlane::Helper::Ios::VersionHelper.bump_version_release
|
16
|
+
create_config
|
17
|
+
show_config
|
18
18
|
|
19
19
|
# Update local default branch and create branch from it
|
20
20
|
Fastlane::Helper::GitHelper.checkout_and_pull(default_branch)
|
21
21
|
Fastlane::Helper::GitHelper.create_branch(@new_release_branch, from: default_branch)
|
22
22
|
UI.message 'Done!'
|
23
23
|
|
24
|
-
UI.message 'Updating Fastlane deliver file...' unless params[:skip_deliver]
|
25
|
-
Fastlane::Helper::Ios::VersionHelper.update_fastlane_deliver(@new_short_version) unless params[:skip_deliver]
|
26
|
-
UI.message 'Done!' unless params[:skip_deliver]
|
27
|
-
|
28
24
|
UI.message 'Updating XcConfig...'
|
29
25
|
Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_version, @new_short_version, @new_version_internal)
|
30
26
|
UI.message 'Done!'
|
31
27
|
|
32
|
-
Fastlane::Helper::Ios::GitHelper.commit_version_bump
|
33
|
-
include_deliverfile: !params[:skip_deliver],
|
34
|
-
include_metadata: false
|
35
|
-
)
|
28
|
+
Fastlane::Helper::Ios::GitHelper.commit_version_bump
|
36
29
|
|
37
30
|
UI.message 'Done.'
|
38
31
|
end
|
@@ -51,11 +44,6 @@ module Fastlane
|
|
51
44
|
|
52
45
|
def self.available_options
|
53
46
|
[
|
54
|
-
FastlaneCore::ConfigItem.new(key: :skip_deliver,
|
55
|
-
env_name: 'FL_IOS_CODEFREEZE_BUMP_SKIPDELIVER',
|
56
|
-
description: 'Skips Deliver key update',
|
57
|
-
type: Boolean,
|
58
|
-
default_value: false),
|
59
47
|
FastlaneCore::ConfigItem.new(key: :default_branch,
|
60
48
|
env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
|
61
49
|
description: 'Default branch of the repository',
|
@@ -78,11 +66,9 @@ module Fastlane
|
|
78
66
|
[:ios, :mac].include?(platform)
|
79
67
|
end
|
80
68
|
|
81
|
-
private
|
82
|
-
|
83
69
|
def self.create_config
|
84
|
-
@current_version = Fastlane::Helper::Ios::VersionHelper.get_build_version
|
85
|
-
@current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version
|
70
|
+
@current_version = Fastlane::Helper::Ios::VersionHelper.get_build_version
|
71
|
+
@current_version_internal = Fastlane::Helper::Ios::VersionHelper.get_internal_version unless ENV['INTERNAL_CONFIG_FILE'].nil?
|
86
72
|
@new_version_internal = Fastlane::Helper::Ios::VersionHelper.create_internal_version(@new_version) unless ENV['INTERNAL_CONFIG_FILE'].nil?
|
87
73
|
@new_short_version = Fastlane::Helper::Ios::VersionHelper.get_short_version_string(@new_version)
|
88
74
|
@new_release_branch = "release/#{@new_short_version}"
|
@@ -4,9 +4,8 @@ module Fastlane
|
|
4
4
|
def self.run(params)
|
5
5
|
require_relative '../../helper/ios/ios_version_helper'
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
Fastlane::Helper::Ios::VersionHelper.get_public_version
|
7
|
+
public_version_xcconfig_file = params[:public_version_xcconfig_file]
|
8
|
+
Fastlane::Helper::Ios::VersionHelper.get_xcconfig_public_version(xcconfig_file: public_version_xcconfig_file)
|
10
9
|
end
|
11
10
|
|
12
11
|
#####################################################
|
@@ -22,7 +21,15 @@ module Fastlane
|
|
22
21
|
end
|
23
22
|
|
24
23
|
def self.available_options
|
25
|
-
|
24
|
+
[
|
25
|
+
FastlaneCore::ConfigItem.new(
|
26
|
+
key: :public_version_xcconfig_file,
|
27
|
+
env_name: 'FL_IOS_PUBLIC_VERSION_XCCONFIG_FILE',
|
28
|
+
description: 'Path to the .xcconfig file containing the public app version',
|
29
|
+
type: String,
|
30
|
+
optional: false
|
31
|
+
),
|
32
|
+
]
|
26
33
|
end
|
27
34
|
|
28
35
|
def self.output
|
@@ -28,7 +28,7 @@ module Fastlane
|
|
28
28
|
UI.crash!("Version #{prev_ver} is not tagged! Can't branch. Abort!") unless other_action.git_tag_exists(tag: prev_ver)
|
29
29
|
|
30
30
|
# Check local repo status
|
31
|
-
other_action.ensure_git_status_clean
|
31
|
+
other_action.ensure_git_status_clean
|
32
32
|
|
33
33
|
# Return the current version
|
34
34
|
prev_ver
|
@@ -68,7 +68,7 @@ module Fastlane
|
|
68
68
|
duplicate_keys
|
69
69
|
end
|
70
70
|
|
71
|
-
RETRY_MESSAGE = <<~MSG
|
71
|
+
RETRY_MESSAGE = <<~MSG.freeze
|
72
72
|
Inconsistencies found during Localization linting.
|
73
73
|
You need to fix them before continuing. From this point on, you should either:
|
74
74
|
|
@@ -91,7 +91,7 @@ module Fastlane
|
|
91
91
|
Did you fix the `.strings` files locally and want to lint them again?
|
92
92
|
MSG
|
93
93
|
|
94
|
-
ABORT_MESSAGE = <<~MSG
|
94
|
+
ABORT_MESSAGE = <<~MSG.freeze
|
95
95
|
Inconsistencies found during Localization linting. Aborting.
|
96
96
|
MSG
|
97
97
|
|
@@ -5,8 +5,8 @@ module Fastlane
|
|
5
5
|
require_relative '../../helper/ios/ios_version_helper'
|
6
6
|
require_relative '../../helper/ios/ios_git_helper'
|
7
7
|
|
8
|
-
itc_ver = Fastlane::Helper::Ios::VersionHelper.get_build_version
|
9
|
-
int_ver = Fastlane::Helper::Ios::VersionHelper.get_internal_version
|
8
|
+
itc_ver = Fastlane::Helper::Ios::VersionHelper.get_build_version
|
9
|
+
int_ver = Fastlane::Helper::Ios::VersionHelper.get_internal_version unless ENV['INTERNAL_CONFIG_FILE'].nil?
|
10
10
|
Fastlane::Helper::GitHelper.create_tag(itc_ver)
|
11
11
|
Fastlane::Helper::GitHelper.create_tag(int_ver) unless int_ver.nil?
|
12
12
|
end
|
@@ -3,7 +3,7 @@ module Fastlane
|
|
3
3
|
class IosUpdateMetadataSourceAction < Action
|
4
4
|
def self.run(params)
|
5
5
|
# Check local repo status
|
6
|
-
other_action.ensure_git_status_clean
|
6
|
+
other_action.ensure_git_status_clean
|
7
7
|
|
8
8
|
other_action.gp_update_metadata_source(po_file_path: params[:po_file_path],
|
9
9
|
source_files: params[:source_files],
|
@@ -43,21 +43,21 @@ module Fastlane
|
|
43
43
|
description: 'The path of the .po file to update',
|
44
44
|
type: String,
|
45
45
|
verify_block: proc do |value|
|
46
|
-
UI.user_error!("No .po file path for UpdateMetadataSourceAction given, pass using `po_file_path: 'file path'`") unless value &&
|
46
|
+
UI.user_error!("No .po file path for UpdateMetadataSourceAction given, pass using `po_file_path: 'file path'`") unless value && !value.empty?
|
47
47
|
UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
|
48
48
|
end),
|
49
49
|
FastlaneCore::ConfigItem.new(key: :release_version,
|
50
50
|
env_name: 'FL_IOS_UPDATE_METADATA_SOURCE_RELEASE_VERSION',
|
51
51
|
description: 'The release version of the app (to use to mark the release notes)',
|
52
52
|
verify_block: proc do |value|
|
53
|
-
UI.user_error!("No relase version for UpdateMetadataSourceAction given, pass using `release_version: 'version'`") unless value &&
|
53
|
+
UI.user_error!("No relase version for UpdateMetadataSourceAction given, pass using `release_version: 'version'`") unless value && !value.empty?
|
54
54
|
end),
|
55
55
|
FastlaneCore::ConfigItem.new(key: :source_files,
|
56
56
|
env_name: 'FL_IOS_UPDATE_METADATA_SOURCE_SOURCE_FILES',
|
57
57
|
description: 'The hash with the path to the source files and the key to use to include their content',
|
58
58
|
type: Hash,
|
59
59
|
verify_block: proc do |value|
|
60
|
-
UI.user_error!("No source file hash for UpdateMetadataSourceAction given, pass using `source_files: 'source file hash'`") unless value &&
|
60
|
+
UI.user_error!("No source file hash for UpdateMetadataSourceAction given, pass using `source_files: 'source file hash'`") unless value && !value.empty?
|
61
61
|
end),
|
62
62
|
]
|
63
63
|
end
|
@@ -5,8 +5,8 @@ module Fastlane
|
|
5
5
|
require_relative '../../helper/ios/ios_git_helper'
|
6
6
|
require_relative '../../helper/ios/ios_version_helper'
|
7
7
|
|
8
|
-
version = Fastlane::Helper::Ios::VersionHelper.get_public_version
|
9
|
-
head_tags = Fastlane::Helper::GitHelper.list_tags_on_current_commit
|
8
|
+
version = Fastlane::Helper::Ios::VersionHelper.get_public_version
|
9
|
+
head_tags = Fastlane::Helper::GitHelper.list_tags_on_current_commit
|
10
10
|
UI.user_error!('HEAD is not on tag. Aborting!') if head_tags.empty?
|
11
11
|
|
12
12
|
return head_tags.include?(version) # Current commit is tagged with "version" tag
|
@@ -54,30 +54,29 @@ module Fastlane
|
|
54
54
|
# Search for the string in the main file
|
55
55
|
result = :added
|
56
56
|
main_strings_xml.xpath('//string').each do |main_string_node|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
end
|
74
|
-
return :updated
|
57
|
+
next unless main_string_node.attr('name') == string_name
|
58
|
+
# Skip if the string has the content_override tag
|
59
|
+
return :skipped if skip_string_by_tag?(main_string_node)
|
60
|
+
|
61
|
+
# If nodes are equivalent, skip
|
62
|
+
return :found if lib_string_node =~ main_string_node
|
63
|
+
|
64
|
+
# The string needs an update
|
65
|
+
if main_string_node.attr('tools:ignore').nil?
|
66
|
+
# No `tools:ignore` attribute; completely replace existing main string node with lib's one
|
67
|
+
add_xml_attributes!(lib_string_node, library)
|
68
|
+
main_string_node.replace lib_string_node
|
69
|
+
else
|
70
|
+
# Has the `tools:ignore` flag; update the content without touching the other existing attributes
|
71
|
+
add_xml_attributes!(main_string_node, library)
|
72
|
+
main_string_node.content = string_content
|
75
73
|
end
|
74
|
+
return :updated
|
76
75
|
end
|
77
76
|
|
78
77
|
# String not found, or removed because needing update and not in the exclusion list: add to the main file
|
79
78
|
add_xml_attributes!(lib_string_node, library)
|
80
|
-
main_strings_xml.xpath('//string').last
|
79
|
+
main_strings_xml.xpath('//string').last.add_next_sibling("\n#{' ' * 4}#{lib_string_node.to_xml.strip}")
|
81
80
|
return result
|
82
81
|
end
|
83
82
|
|
@@ -91,14 +90,13 @@ module Fastlane
|
|
91
90
|
|
92
91
|
# Search for the string in the main file
|
93
92
|
main_strings_xml.xpath('//string').each do |main_string_node|
|
94
|
-
|
95
|
-
|
96
|
-
|
93
|
+
next unless main_string_node.attr('name') == string_name
|
94
|
+
# Skip if the string has the content_override tag
|
95
|
+
return if skip_string_by_tag?(main_string_node)
|
97
96
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
end
|
97
|
+
# Check if up-to-date
|
98
|
+
UI.user_error!("String #{string_name} [#{string_content}] has been updated in the main file but not in the library #{library[:library]}.") if main_string_node.content != string_content
|
99
|
+
return
|
102
100
|
end
|
103
101
|
|
104
102
|
# String not found and not in the exclusion list
|
@@ -133,14 +131,14 @@ module Fastlane
|
|
133
131
|
case res
|
134
132
|
when :updated
|
135
133
|
UI.verbose "#{string_node.attr('name')} updated."
|
136
|
-
updated_count
|
134
|
+
updated_count += 1
|
137
135
|
when :found
|
138
|
-
untouched_count
|
136
|
+
untouched_count += 1
|
139
137
|
when :added
|
140
138
|
UI.verbose "#{string_node.attr('name')} added."
|
141
|
-
added_count
|
139
|
+
added_count += 1
|
142
140
|
when :skipped
|
143
|
-
skipped_count
|
141
|
+
skipped_count += 1
|
144
142
|
else
|
145
143
|
UI.user_error!("Internal Error! #{res}")
|
146
144
|
end
|
@@ -180,22 +178,22 @@ module Fastlane
|
|
180
178
|
|
181
179
|
def self.verify_local_diff(main, library, main_strings, lib_strings)
|
182
180
|
`git diff #{main}`.each_line do |line|
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
181
|
+
next unless line.start_with?('+ ') || line.start_with?('- ')
|
182
|
+
|
183
|
+
diffs = line.gsub(/\s+/m, ' ').strip.split
|
184
|
+
diffs.each do |diff|
|
185
|
+
verify_diff(diff, main_strings, lib_strings, library)
|
188
186
|
end
|
189
187
|
end
|
190
188
|
end
|
191
189
|
|
192
190
|
def self.verify_pr_diff(main, library, main_strings, lib_strings, source_diff)
|
193
191
|
source_diff.each_line do |line|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
192
|
+
next unless line.start_with?('+ ') || line.start_with?('- ')
|
193
|
+
|
194
|
+
diffs = line.gsub(/\s+/m, ' ').strip.split
|
195
|
+
diffs.each do |diff|
|
196
|
+
verify_diff(diff, main_strings, lib_strings, library)
|
199
197
|
end
|
200
198
|
end
|
201
199
|
end
|
@@ -234,7 +232,7 @@ module Fastlane
|
|
234
232
|
# An array of locales to download. Each item in the array must be a Hash
|
235
233
|
# with keys `:glotpress` and `:android` containing the respective locale codes.
|
236
234
|
#
|
237
|
-
def self.download_from_glotpress(res_dir:, glotpress_project_url:, glotpress_filters: { status: 'current' }
|
235
|
+
def self.download_from_glotpress(res_dir:, glotpress_project_url:, locales_map:, glotpress_filters: { status: 'current' })
|
238
236
|
glotpress_filters = [glotpress_filters] unless glotpress_filters.is_a?(Array)
|
239
237
|
|
240
238
|
attributes_to_copy = %w[formatted] # Attributes that we want to replicate into translated `string.xml` files
|