diff --git a/.buildkite/commands/lint-localized-strings-format.sh b/.buildkite/commands/lint-localized-strings-format.sh new file mode 100755 index 00000000000..5e4a9f4d3d4 --- /dev/null +++ b/.buildkite/commands/lint-localized-strings-format.sh @@ -0,0 +1,8 @@ +#!/bin/bash -eu + +echo "--- :writing_hand: Copy Files" +SECRETS_DIR=~/.configure/woocommerce-ios/secrets +mkdir -pv $SECRETS_DIR +cp -v fastlane/env/project.env.example $SECRETS_DIR/project.env + +lint_localized_strings_format diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index cde74f65676..79565eef3f7 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -2,7 +2,7 @@ common_params: # Common plugin settings to use with the `plugins` key. - &common_plugins - - automattic/bash-cache#2.8.0 + - automattic/bash-cache#2.12.0 - automattic/git-s3-cache#v1.1.3: bucket: "a8c-repo-mirrors" # This is not necessarily the actual name of the repo or the GitHub organization @@ -55,18 +55,25 @@ steps: context: "Unit Tests" ################# - # Lint Translations + # Linters ################# - - label: "🧹 Lint Translations" - command: "gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot" - plugins: - - docker#v3.8.0: - image: "public.ecr.aws/automattic/glotpress-validator:1.0.0" - agents: - queue: "default" - notify: - - github_commit_status: - context: "Lint Translations" + - group: Linters + steps: + - label: "🧹 Lint Translations" + command: "gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot" + plugins: + - docker#v3.8.0: + image: "public.ecr.aws/automattic/glotpress-validator:1.0.0" + agents: + queue: "default" + notify: + - github_commit_status: + context: "Lint Translations" + + - label: ":sleuth_or_spy: Lint Localized Strings Format" + command: .buildkite/commands/lint-localized-strings-format.sh + plugins: *common_plugins + env: *common_env ################# # UI Tests diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 65b2de41113..4efe3f39bc9 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -976,8 +976,15 @@ platform :ios do configure_validate end + # Generates the `.strings` file to be imported by GlotPress, by parsing source code (using `genstrings` under the hood). + # + # + # @option [Boolean] skip_commit (default: false) If true, does not commit the changes made to the `.strings` file. + # + # @called_by complete_code_freeze + # desc 'Updates the main `Localizable.strings` file — that will be imported by GlotPress — from code and `Info.plist` files' - lane :generate_strings_file_for_glotpress do + lane :generate_strings_file_for_glotpress do |options| cocoapods en_lproj_path = File.join(RESOURCES_FOLDER, 'en.lproj') @@ -1006,6 +1013,8 @@ platform :ios do destination: File.join(en_lproj_path, 'Localizable.strings') ) + next if options.fetch(:skip_commit, false) + git_commit( path: en_lproj_path, message: 'Freeze strings for localization',