Merge translations #1
This file contains hidden or 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: Merge translations | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
env: | ||
CPYTHON_BRANCH: '3.14' | ||
LANGUAGE: 'ja' | ||
jobs: | ||
merge: | ||
# Merge translations previously updated into older branches to make sure | ||
# older versions of Python Docs gets translated as well. | ||
name: merge into ${{ matrix.branch }} | ||
needs: [update] | ||
strategy: | ||
matrix: | ||
branch: [ "3.13", "3.12", "3.11" ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out source branch (${{ env.CPYTHON_BRANCH }}) | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ${{ env.CPYTHON_BRANCH }} | ||
- name: Check out target branch (${{ matrix.branch }}) | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ matrix.branch }} | ||
path: ${{ matrix.branch }} | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
cache: 'pip' | ||
cache-dependency-path: '**/requirements*.txt' | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update -y && sudo apt-get install gettext -y | ||
pip install pomerge powrap | ||
- name: Merge overwriting on stable release branch | ||
run: | | ||
pomerge --from "${{ env.CPYTHON_BRANCH }}"/**/*.po --to "${{ matrix.branch }}"/**/*.po | ||
- name: Wrap catalog message files | ||
run: | | ||
powrap --modified -C "${{ matrix.branch }}" | ||
git diff | ||
- name: Commit and push changes | ||
if: github.repository == 'python/python-docs-ja' | ||
run: | | ||
cd "${{ matrix.branch }}" | ||
git config user.name github-actions | ||
git config user.email github-actions@github.com | ||
git status | ||
git add -A | ||
git diff-index --quiet HEAD || ( git commit -m "Merge ${{ env.CPYTHON_BRANCH }} into ${{ matrix.branch }}" && git push ) | ||