Skip to content

Commit 1de6c89

Browse files
authored
[Tooling] Extract download translations to separate process (#15139)
2 parents a477857 + 71b73ca commit 1de6c89

File tree

2 files changed

+64
-17
lines changed

2 files changed

+64
-17
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
2+
---
3+
4+
agents:
5+
queue: mac
6+
7+
env:
8+
IMAGE_ID: $IMAGE_ID
9+
10+
steps:
11+
- label: Download Release Translations
12+
plugins: [$CI_TOOLKIT]
13+
command: |
14+
echo '--- :robot_face: Use bot for Git operations'
15+
source use-bot-for-git
16+
17+
.buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION"
18+
19+
echo '--- :ruby: Setup Ruby Tools'
20+
install_gems
21+
22+
echo '--- :closed_lock_with_key: Access Secrets'
23+
bundle exec fastlane run configure_apply
24+
25+
echo '--- :globe_with_meridians: Download Release Translations'
26+
bundle exec fastlane download_release_translations skip_confirm:true
27+
retry:
28+
manual:
29+
# If those jobs fail, one should always prefer re-triggering a new build from ReleaseV2 rather than retrying the individual job from Buildkite
30+
allowed: false

fastlane/Fastfile

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -465,34 +465,51 @@ platform :ios do
465465
end
466466
end
467467

468-
#####################################################################################
469-
# finalize_release
470-
# -----------------------------------------------------------------------------------
471-
# This lane finalize a release: updates store metadata, bump final version number,
472-
# remove branch protection and close milestone, then trigger the final release on CI
473-
# -----------------------------------------------------------------------------------
474-
# Usage:
475-
# bundle exec fastlane finalize_release [skip_confirm:<skip confirm>] [version:<version>]
468+
# Downloads and prepares the latest translations from GlotPress for App Store submission,
469+
# then pushes the changes to the remote repository
476470
#
477-
# Example:
478-
# bundle exec fastlane finalize_release
479-
# bundle exec fastlane finalize_release skip_confirm:true
480-
#####################################################################################
481-
desc 'Trigger the final release build on CI'
482-
lane :finalize_release do |skip_confirm: false|
483-
UI.user_error!('To finalize a hotfix, please use the `finalize_hotfix_release` lane instead') if release_is_hotfix?
484-
471+
# @param [Boolean] skip_confirm (default: false) If set, will skip the confirmation prompt before running the rest of the lane
472+
#
473+
# @example Running the lane
474+
# bundle exec fastlane download_release_translations skip_confirm:true
475+
#
476+
lane :download_release_translations do |skip_confirm: false|
485477
ensure_git_status_clean
486478
ensure_git_branch_is_release_branch!
487479

488-
UI.important("Finalizing release: #{release_version_current}")
480+
UI.important("Downloading latest translations for version #{release_version_current}")
489481
UI.user_error!("Terminating as requested. Don't forget to run the remainder of this automation manually.") unless skip_confirm || UI.confirm('Do you want to continue?')
490482

491483
# Don't check translation coverage in CI
492484
check_translation_progress_all unless is_ci
493485
download_localized_strings_and_metadata_from_glotpress
494486
lint_localizations
495487

488+
UI.important('Pushing changes to remote')
489+
UI.user_error!("Terminating as requested. Don't forget to run the remainder of this automation manually.") unless skip_confirm || UI.confirm('Do you want to continue?')
490+
491+
push_to_git_remote(tags: false)
492+
493+
UI.success("Successfully downloaded and committed latest translations for #{release_version_current}")
494+
end
495+
496+
# Finalizes a release by bumping version number, removing branch protection, closing milestone,
497+
# and triggering the final release build on CI
498+
#
499+
# @param [Boolean] skip_confirm (default: false) If set, will skip the confirmation prompt before running the rest of the lane
500+
#
501+
# @example Running the lane
502+
# bundle exec fastlane finalize_release skip_confirm:true
503+
#
504+
lane :finalize_release do |skip_confirm: false|
505+
UI.user_error!('To finalize a hotfix, please use the `finalize_hotfix_release` lane instead') if release_is_hotfix?
506+
507+
ensure_git_status_clean
508+
ensure_git_branch_is_release_branch!
509+
510+
UI.important("Finalizing release: #{release_version_current}")
511+
UI.user_error!("Terminating as requested. Don't forget to run the remainder of this automation manually.") unless skip_confirm || UI.confirm('Do you want to continue?')
512+
496513
# Bump the build code
497514
UI.message('Bumping build code...')
498515
VERSION_FILE.write(version_long: build_code_next)

0 commit comments

Comments
 (0)