Import strings #118
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Import strings | |
on: | |
schedule: | |
- cron: "10 15 * * 2" # At 8:10 PDT on Tuesday | |
workflow_dispatch: | |
inputs: | |
type: | |
description: Type of update (standard, nofile, matchid) | |
required: true | |
default: "standard" | |
jobs: | |
build: | |
runs-on: macos-13 | |
strategy: | |
max-parallel: 4 | |
matrix: | |
xcode: | |
- "15.0.1" | |
steps: | |
- name: Clone l10n repository | |
uses: actions/checkout@v4 | |
with: | |
path: "l10n_repo" | |
- name: Clone main code repository | |
uses: actions/checkout@v4 | |
with: | |
repository: "mozilla-mobile/firefox-ios" | |
path: "code_repo" | |
- name: Select Xcode ${{ matrix.xcode }} | |
run: | | |
sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app | |
- name: Set up Python 3 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install Python dependencies | |
run: | | |
pip install -r l10n_repo/.github/scripts/requirements.txt | |
- name: Run checkout script | |
run: | | |
(cd code_repo && ./checkout.sh) | |
- name: Extract strings | |
run: | | |
(cd code_repo && ./focus-ios/focus-ios-tests/tools/export-strings.sh) | |
# Copy strings to other locales | |
cp code_repo/focus-ios/focusios-l10n/en-US/*.xliff l10n_repo/en-US/ | |
python l10n_repo/.github/scripts/translate_reference.py --path l10n_repo/en-US | |
python l10n_repo/.github/scripts/update_other_locales.py --reference en-US --path l10n_repo --type "${{ github.event.inputs.type }}" | |
- name: Get the current date for PR title | |
run: echo "current_date=$(date +"%Y-%m-%d")" >> $GITHUB_ENV | |
- run : git config --global user.email "[email protected]" | |
- uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.IOS_L10N_TOKEN }} | |
path: "l10n_repo" | |
commit-message: "Extract new strings (${{ env.current_date }})" | |
branch: l10n_automation | |
delete-branch: true | |
title: "Extract new strings (${{ env.current_date }})" |