Update #22
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
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
name: Update | |
on: | |
schedule: | |
- cron: "0 11,23 * * 1-5" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout l10n:main | |
uses: actions/checkout@v4 | |
with: { ref: main, fetch-depth: 0 } | |
- name: Refresh l10n:update | |
run: git push origin HEAD:update || true | |
update: | |
needs: prepare | |
strategy: | |
max-parallel: 1 | |
matrix: | |
ref: [master, beta, release, esr115] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout l10n:update | |
uses: actions/checkout@v4 | |
with: { ref: update, path: l10n } | |
- name: Checkout firefox:${{ matrix.ref }} | |
uses: actions/checkout@v4 | |
with: | |
repository: mozilla/gecko-dev | |
ref: ${{ matrix.ref }} | |
path: firefox | |
# TODO: These paths should be generated from the l10n.toml files | |
sparse-checkout: | | |
browser/branding/official/locales | |
browser/extensions/formautofill/locales | |
browser/extensions/report-site-issue/locales | |
browser/locales | |
devtools/client/locales | |
devtools/shared/locales | |
devtools/startup/locales | |
dom/locales | |
mobile/android/branding/official/locales | |
mobile/android/locales | |
netwerk/locales | |
security/manager/locales | |
toolkit/locales | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: pip | |
cache-dependency-path: l10n/_scripts/requirements.txt | |
- run: pip install -r l10n/_scripts/requirements.txt | |
- run: > | |
python -m _scripts.update | |
--branch ${{ matrix.ref }} | |
--commit $(cd ../firefox && git rev-parse --short HEAD) | |
--firefox ../firefox | |
--configs browser/locales/l10n.toml mobile/android/locales/l10n.toml | |
working-directory: l10n | |
- name: git config | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- run: git add . | |
working-directory: l10n | |
- name: git commit & push any changes | |
run: | | |
git diff-index --quiet HEAD || (git commit -F .update_msg && git push) | |
working-directory: l10n | |
cleanup: | |
needs: update | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout l10n:update | |
uses: actions/checkout@v4 | |
with: { ref: update } | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: pip | |
cache-dependency-path: _scripts/requirements.txt | |
- run: pip install -r _scripts/requirements.txt | |
# TODO: This list should be generated from the update matrix | |
- run: python -m _scripts.prune master beta release esr115 | |
- name: git config | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- run: git add . | |
- name: git commit & push any changes | |
run: git diff-index --quiet HEAD || (git commit -F .prune_msg && git push) | |
- run: gh pr create --base main --head update --title "Update messages" --body "" || true | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |