fastlane-plugin-wpmreleasetoolkit 1.0.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.
- checksums.yaml +7 -0
- data/LICENSE +339 -0
- data/README.md +38 -0
- data/bin/drawText +19 -0
- data/ext/drawText/extconf.rb +36 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit.rb +16 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/README.md +20 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_localize_libs_action.rb +53 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb +171 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_validate_lib_strings_action.rb +63 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +103 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +83 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_preflight.rb +54 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb +69 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_final_release.rb +58 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +77 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb +89 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +79 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +68 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_xml_release_notes.rb +63 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb +44 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_file_by_version.rb +79 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb +115 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +71 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_alpha_version.rb +44 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_app_version.rb +44 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_release_version.rb +44 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_hotifx_prechecks.rb +78 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_merge_translators_strings.rb +106 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb +51 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_metadata.rb +52 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb +56 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/circleci_trigger_job_action.rb +63 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/close_milestone_action.rb +56 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb +59 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb +91 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb +89 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_list_action.rb +64 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb +90 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb +170 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb +247 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/removebranchprotection_action.rb +57 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setbranchprotection_action.rb +56 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setfrozentag_action.rb +81 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb +96 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_apply_action.rb +139 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb +57 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb +86 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb +139 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_validate_action.rb +134 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_development_certificates_to_provisioning_profiles.rb +77 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb +79 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb +92 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb +74 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb +78 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb +68 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +87 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb +114 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_check_beta_deps.rb +62 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_clear_intermediate_tags.rb +60 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb +70 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb +63 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_current_branch_is_hotfix.rb +40 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb +52 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb +64 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_app_version.rb +47 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb +60 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb +121 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_hotifx_prechecks.rb +78 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb +167 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_localize_project.rb +44 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_merge_translators_strings.rb +93 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_tag_build.rb +44 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata.rb +40 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb +81 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb +56 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_validate_ci_build.rb +46 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/an_metadata_update_helper.rb +152 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_git_helper.rb +44 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb +359 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +475 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ci_helper.rb +91 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/configure_helper.rb +282 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/encryption_helper.rb +51 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/filesystem_helper.rb +93 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb +224 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +135 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_adc_app_sizes_helper.rb +74 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_git_helper.rb +80 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_helper.rb +208 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb +348 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb +107 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_update_helper.rb +182 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb +399 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/release_notes_helper.rb +21 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/models/configuration.rb +40 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/models/file_reference.rb +86 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +5 -0
- metadata +449 -0
data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_xml_release_notes.rb
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
module Fastlane
|
|
2
|
+
module Actions
|
|
3
|
+
class AndroidCreateXmlReleaseNotesAction < Action
|
|
4
|
+
def self.run(params)
|
|
5
|
+
require_relative '../../helper/android/android_git_helper.rb'
|
|
6
|
+
|
|
7
|
+
release_notes_path = params[:download_path] + '/release_notes.xml'
|
|
8
|
+
open(release_notes_path, 'w') do |f|
|
|
9
|
+
params[:locales].each do |loc|
|
|
10
|
+
puts "Looking for language: #{loc[1]}"
|
|
11
|
+
complete_path = "#{params[:download_path]}/#{loc[1]}/changelogs/#{params[:build_number]}.txt"
|
|
12
|
+
if File.exist?(complete_path)
|
|
13
|
+
f.puts("<#{loc[1]}>")
|
|
14
|
+
f.puts(File.open(complete_path).read)
|
|
15
|
+
f.puts("</#{loc[1]}>\n")
|
|
16
|
+
else
|
|
17
|
+
UI.message("File #{complete_path} not found. Skipping language #{loc[1]}")
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
#####################################################
|
|
24
|
+
# @!group Documentation
|
|
25
|
+
#####################################################
|
|
26
|
+
|
|
27
|
+
def self.description
|
|
28
|
+
'Downloads translated metadata from the translation system'
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.details
|
|
32
|
+
'Downloads translated metadata from the translation system'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.available_options
|
|
36
|
+
[
|
|
37
|
+
FastlaneCore::ConfigItem.new(key: :download_path,
|
|
38
|
+
env_name: 'ANDROID_XML_NOTES_DOWNLOAD_PATH',
|
|
39
|
+
description: 'The path to the folder with the release notes',
|
|
40
|
+
optional: false,
|
|
41
|
+
is_string: true),
|
|
42
|
+
FastlaneCore::ConfigItem.new(key: :build_number,
|
|
43
|
+
env_name: 'ANDROID_XML_NOTES_BUILD_NUMBER',
|
|
44
|
+
description: 'The build number of the release notes',
|
|
45
|
+
optional: false,
|
|
46
|
+
is_string: true),
|
|
47
|
+
FastlaneCore::ConfigItem.new(key: :locales,
|
|
48
|
+
env_name: 'FL_DOWNLOAD_METADATA_LOCALES',
|
|
49
|
+
description: 'The hash with the GLotPress locale and the project locale association',
|
|
50
|
+
is_string: false),
|
|
51
|
+
]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def self.authors
|
|
55
|
+
['loremattei']
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def self.is_supported?(platform)
|
|
59
|
+
platform == :android
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
module Fastlane
|
|
2
|
+
module Actions
|
|
3
|
+
module SharedValues
|
|
4
|
+
ANDROID_CURRENT_BRANCH_IS_HOTFIX_CUSTOM_VALUE = :ANDROID_CURRENT_BRANCH_IS_HOTFIX_CUSTOM_VALUE
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
class AndroidCurrentBranchIsHotfixAction < Action
|
|
8
|
+
def self.run(params)
|
|
9
|
+
require_relative '../../helper/android/android_version_helper.rb'
|
|
10
|
+
Fastlane::Helper::Android::VersionHelper.is_hotfix?(Fastlane::Helper::Android::VersionHelper.get_release_version)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
#####################################################
|
|
14
|
+
# @!group Documentation
|
|
15
|
+
#####################################################
|
|
16
|
+
|
|
17
|
+
def self.description
|
|
18
|
+
'Checks if the current branch is for a hotfix'
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.details
|
|
22
|
+
'Checks if the current branch is for a hotfix'
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.available_options
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def self.output
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.return_value
|
|
32
|
+
'True if the branch is for a hotfix, false otherwise'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.authors
|
|
36
|
+
['loremattei']
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def self.is_supported?(platform)
|
|
40
|
+
platform == :android
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_file_by_version.rb
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
module Fastlane
|
|
2
|
+
module Actions
|
|
3
|
+
class AndroidDownloadFileByVersionAction < Action
|
|
4
|
+
def self.run(params)
|
|
5
|
+
require_relative '../../helper/android/android_localize_helper.rb'
|
|
6
|
+
require_relative '../../helper/github_helper'
|
|
7
|
+
|
|
8
|
+
version = Fastlane::Helper::Android::VersionHelper.get_library_version_from_gradle_config(import_key: params[:import_key])
|
|
9
|
+
UI.user_error!("Can't find any reference for key #{params[:import_key]}") if version.nil?
|
|
10
|
+
UI.message "Downloading #{params[:file_path]} from #{params[:repository]} at version #{version} to #{params[:download_folder]}"
|
|
11
|
+
|
|
12
|
+
Fastlane::Helper::GithubHelper.download_file_from_tag(
|
|
13
|
+
repository: params[:repository],
|
|
14
|
+
tag: "#{params[:github_release_prefix]}#{version}",
|
|
15
|
+
file_path: params[:file_path],
|
|
16
|
+
download_folder: params[:download_folder]
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
#####################################################
|
|
21
|
+
# @!group Documentation
|
|
22
|
+
#####################################################
|
|
23
|
+
|
|
24
|
+
def self.description
|
|
25
|
+
'Downloads a file from a GitHub release based on the version used by the client app'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def self.details
|
|
29
|
+
'This action extracts the version of the library which is imported by the client app' \
|
|
30
|
+
'and downloads the request file from the relevant GitHub release'
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.available_options
|
|
34
|
+
[
|
|
35
|
+
FastlaneCore::ConfigItem.new(key: :library_name,
|
|
36
|
+
description: 'The display name of the library',
|
|
37
|
+
type: String,
|
|
38
|
+
optional: false),
|
|
39
|
+
FastlaneCore::ConfigItem.new(key: :import_key,
|
|
40
|
+
description: 'The key which is used in build.gradle to reference the version of the library to import',
|
|
41
|
+
type: String,
|
|
42
|
+
optional: false),
|
|
43
|
+
FastlaneCore::ConfigItem.new(key: :repository,
|
|
44
|
+
description: "The GitHub repository slug ('<orgname>/<reponame>') which hosts the library project",
|
|
45
|
+
type: String,
|
|
46
|
+
optional: false),
|
|
47
|
+
FastlaneCore::ConfigItem.new(key: :file_path,
|
|
48
|
+
description: 'The path of the file to download',
|
|
49
|
+
type: String,
|
|
50
|
+
optional: false),
|
|
51
|
+
FastlaneCore::ConfigItem.new(key: :download_folder,
|
|
52
|
+
description: 'The download folder',
|
|
53
|
+
type: String,
|
|
54
|
+
optional: true,
|
|
55
|
+
default_value: Dir.tmpdir()),
|
|
56
|
+
FastlaneCore::ConfigItem.new(key: :github_release_prefix,
|
|
57
|
+
description: 'The prefix which is used in the GitHub release title',
|
|
58
|
+
type: String,
|
|
59
|
+
optional: true),
|
|
60
|
+
]
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def self.output
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def self.return_value
|
|
67
|
+
'The path where the file was downloaded to (typically <download_folder>/<basename(file_path)>), or nil if there was an issue downloading the file'
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def self.authors
|
|
71
|
+
['loremattei']
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def self.is_supported?(platform)
|
|
75
|
+
platform == :android
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# This action is the new version of android_update_metadata (AndroidUpdateMetadataAction) and should now be used instead of that one
|
|
2
|
+
|
|
3
|
+
module Fastlane
|
|
4
|
+
module Actions
|
|
5
|
+
class AndroidDownloadTranslationsAction < Action
|
|
6
|
+
def self.run(params)
|
|
7
|
+
require_relative '../../helper/android/android_localize_helper.rb'
|
|
8
|
+
require_relative '../../helper/git_helper.rb'
|
|
9
|
+
|
|
10
|
+
res_dir = File.join(ENV['PROJECT_ROOT_FOLDER'] || '.', params[:res_dir])
|
|
11
|
+
|
|
12
|
+
Fastlane::Helper::Android::LocalizeHelper.create_available_languages_file(
|
|
13
|
+
res_dir: res_dir,
|
|
14
|
+
locale_codes: [params[:source_locale]] + params[:locales].map { |h| h[:android] }
|
|
15
|
+
)
|
|
16
|
+
Fastlane::Helper::Android::LocalizeHelper.download_from_glotpress(
|
|
17
|
+
res_dir: res_dir,
|
|
18
|
+
glotpress_project_url: params[:glotpress_url],
|
|
19
|
+
glotpress_filters: params[:status_filter].map { |s| { status: s } },
|
|
20
|
+
locales_map: params[:locales]
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
# Update submodules then lint translations
|
|
24
|
+
unless params[:lint_task].nil? || params[:lint_task].empty?
|
|
25
|
+
Fastlane::Helper::GitHelper.update_submodules()
|
|
26
|
+
Action.sh('./gradlew', params[:lint_task])
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
Fastlane::Helper::GitHelper.commit(message: 'Update translations', files: res_dir, push: true) unless params[:skip_commit]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
#####################################################
|
|
33
|
+
# @!group Documentation
|
|
34
|
+
#####################################################
|
|
35
|
+
|
|
36
|
+
def self.description
|
|
37
|
+
'Download Android string.xml files from GlotPress and lint the updated translations'
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def self.details
|
|
41
|
+
'Download translations from GlotPress, update local strings.xml files accordingly, lint, commit the changes, and push to the remote'
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def self.available_options
|
|
45
|
+
[
|
|
46
|
+
FastlaneCore::ConfigItem.new(
|
|
47
|
+
key: :res_dir,
|
|
48
|
+
env_name: 'FL_DOWNLOAD_TRANSLATIONS_RES_DIR',
|
|
49
|
+
description: "The path to the Android project's `res` dir (typically the `<project name>/src/main/res` directory) containing the `values-*` subdirs",
|
|
50
|
+
type: String,
|
|
51
|
+
default_value: "#{ENV['PROJECT_NAME']}/src/main/res"
|
|
52
|
+
),
|
|
53
|
+
FastlaneCore::ConfigItem.new(
|
|
54
|
+
key: :glotpress_url,
|
|
55
|
+
env_name: 'FL_DOWNLOAD_TRANSLATIONS_GLOTPRESS_URL',
|
|
56
|
+
description: 'URL to the GlotPress project',
|
|
57
|
+
type: String
|
|
58
|
+
),
|
|
59
|
+
FastlaneCore::ConfigItem.new(
|
|
60
|
+
key: :status_filter,
|
|
61
|
+
env_name: 'FL_DOWNLOAD_TRANSLATIONS_STATUS_FILTER',
|
|
62
|
+
description: 'The GlotPress status(es) to filter on when downloading the translations',
|
|
63
|
+
type: Array,
|
|
64
|
+
default_value: 'current'
|
|
65
|
+
),
|
|
66
|
+
FastlaneCore::ConfigItem.new(
|
|
67
|
+
key: :source_locale,
|
|
68
|
+
env_name: 'FL_DOWNLOAD_TRANSLATIONS_SOURCE_LOCALE',
|
|
69
|
+
description: 'The Android locale code for the source locale (the one serving as original/reference). This will be included into the `available_languages.xml` file',
|
|
70
|
+
type: String,
|
|
71
|
+
default_value: 'en_US'
|
|
72
|
+
),
|
|
73
|
+
FastlaneCore::ConfigItem.new(
|
|
74
|
+
key: :locales,
|
|
75
|
+
description: 'An array of hashes – each with the :glotpress and :android keys – listing the locale codes to download and update',
|
|
76
|
+
type: Array,
|
|
77
|
+
verify_block: proc do |value|
|
|
78
|
+
unless value.is_a?(Array) && value.all? { |e| e.is_a?(Hash) && e.key?(:glotpress) && e.key?(:android) }
|
|
79
|
+
UI.user_error!('The value for the `locales` parameter must be an Array of Hashes, and each Hash must have at least `:glotpress` and `:android` keys.')
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
),
|
|
83
|
+
FastlaneCore::ConfigItem.new(
|
|
84
|
+
key: :lint_task,
|
|
85
|
+
env_name: 'FL_DOWNLOAD_TRANSLATIONS_LINT_TASK',
|
|
86
|
+
description: 'The name of the Gradle task to run to lint the translations (after this action have updated them). Set to nil or empty string to skip the lint',
|
|
87
|
+
type: String,
|
|
88
|
+
optional: true
|
|
89
|
+
),
|
|
90
|
+
FastlaneCore::ConfigItem.new(
|
|
91
|
+
key: :skip_commit,
|
|
92
|
+
env_name: 'FL_DOWNLOAD_TRANSLATIONS_SKIP_COMMIT',
|
|
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
|
|
95
|
+
default_value: false
|
|
96
|
+
),
|
|
97
|
+
]
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def self.output
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def self.return_value
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def self.authors
|
|
107
|
+
['AliSoftware']
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def self.is_supported?(platform)
|
|
111
|
+
platform == :android
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
module Fastlane
|
|
2
|
+
module Actions
|
|
3
|
+
module SharedValues
|
|
4
|
+
ANDROID_FINALIZE_PRECHECKS_CUSTOM_VALUE = :ANDROID_FINALIZE_PRECHECKS_CUSTOM_VALUE
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
class AndroidFinalizePrechecksAction < Action
|
|
8
|
+
def self.run(params)
|
|
9
|
+
UI.message "Skip confirm: #{params[:skip_confirm]}"
|
|
10
|
+
|
|
11
|
+
require_relative '../../helper/android/android_version_helper.rb'
|
|
12
|
+
require_relative '../../helper/android/android_git_helper.rb'
|
|
13
|
+
|
|
14
|
+
UI.user_error!('This is not a release branch. Abort.') unless other_action.git_branch.start_with?('release/')
|
|
15
|
+
|
|
16
|
+
version = Fastlane::Helper::Android::VersionHelper.get_public_version
|
|
17
|
+
message = "Finalizing release: #{version}\n"
|
|
18
|
+
if !params[:skip_confirm]
|
|
19
|
+
UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
|
|
20
|
+
else
|
|
21
|
+
UI.message(message)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Check local repo status
|
|
25
|
+
other_action.ensure_git_status_clean()
|
|
26
|
+
|
|
27
|
+
version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
#####################################################
|
|
31
|
+
# @!group Documentation
|
|
32
|
+
#####################################################
|
|
33
|
+
|
|
34
|
+
def self.description
|
|
35
|
+
'Runs some prechecks before finalizing a release'
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def self.details
|
|
39
|
+
'Runs some prechecks before finalizing a release'
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def self.available_options
|
|
43
|
+
# Define all options your action supports.
|
|
44
|
+
|
|
45
|
+
# Below a few examples
|
|
46
|
+
[
|
|
47
|
+
FastlaneCore::ConfigItem.new(key: :skip_confirm,
|
|
48
|
+
env_name: 'FL_ANDROID_FINALIZE_PRECHECKS_SKIPCONFIRM',
|
|
49
|
+
description: 'Skips confirmation',
|
|
50
|
+
is_string: false, # true: verifies the input is a string, false: every kind of value
|
|
51
|
+
default_value: false), # the default value if the user didn't provide one
|
|
52
|
+
]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def self.output
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def self.return_value
|
|
59
|
+
'The current app version'
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def self.authors
|
|
63
|
+
['loremattei']
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def self.is_supported?(platform)
|
|
67
|
+
platform == :android
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
module Fastlane
|
|
2
|
+
module Actions
|
|
3
|
+
class AndroidGetAlphaVersionAction < Action
|
|
4
|
+
def self.run(params)
|
|
5
|
+
require_relative '../../helper/android/android_version_helper.rb'
|
|
6
|
+
Fastlane::Helper::Android::VersionHelper.get_alpha_version()
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
#####################################################
|
|
10
|
+
# @!group Documentation
|
|
11
|
+
#####################################################
|
|
12
|
+
|
|
13
|
+
def self.description
|
|
14
|
+
'Gets the alpha version of the app'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.details
|
|
18
|
+
'Gets the alpha version of the app'
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.available_options
|
|
22
|
+
# Define all options your action supports.
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.output
|
|
26
|
+
# Define the shared values you are going to provide
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.return_value
|
|
30
|
+
# If you method provides a return value, you can describe here what it does
|
|
31
|
+
'Return the alpha version of the app'
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.authors
|
|
35
|
+
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
|
|
36
|
+
['loremattei']
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def self.is_supported?(platform)
|
|
40
|
+
platform == :android
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
module Fastlane
|
|
2
|
+
module Actions
|
|
3
|
+
class AndroidGetAppVersionAction < Action
|
|
4
|
+
def self.run(params)
|
|
5
|
+
require_relative '../../helper/android/android_version_helper.rb'
|
|
6
|
+
Fastlane::Helper::Android::VersionHelper.get_public_version
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
#####################################################
|
|
10
|
+
# @!group Documentation
|
|
11
|
+
#####################################################
|
|
12
|
+
|
|
13
|
+
def self.description
|
|
14
|
+
'Gets the public version of the app'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.details
|
|
18
|
+
'Gets the public version of the app'
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.available_options
|
|
22
|
+
# Define all options your action supports.
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.output
|
|
26
|
+
# Define the shared values you are going to provide
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.return_value
|
|
30
|
+
# If you method provides a return value, you can describe here what it does
|
|
31
|
+
'Return the public version of the app'
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.authors
|
|
35
|
+
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
|
|
36
|
+
['loremattei']
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def self.is_supported?(platform)
|
|
40
|
+
platform == :android
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|