mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
56 lines
1.6 KiB
YAML
56 lines
1.6 KiB
YAML
name: Sync translations on repository and transifex.com
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * SUN"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
push:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: 4.x
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.9 # https://github.com/transifex/transifex-client/pull/330
|
|
- name: Install dependencies
|
|
run: pip install -U babel jinja2 transifex-client
|
|
- name: Extract translations from source code
|
|
run: python setup.py extract_messages
|
|
- name: Push translations to transifex.com
|
|
run: cd sphinx/locale && tx push -s --no-interactive --parallel
|
|
env:
|
|
TX_TOKEN: ${{ secrets.TX_TOKEN }}
|
|
|
|
pull:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: 4.x
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.9 # https://github.com/transifex/transifex-client/pull/330
|
|
- name: Install dependencies
|
|
run: pip install -U babel jinja2 transifex-client
|
|
- name: Extract translations from source code
|
|
run: python setup.py extract_messages
|
|
- name: Pull translations to transifex.com
|
|
run: cd sphinx/locale && tx pull -a -f --no-interactive --parallel
|
|
env:
|
|
TX_TOKEN: ${{ secrets.TX_TOKEN }}
|
|
- name: Compile message catalogs
|
|
run: python setup.py compile_catalog
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v3
|
|
with:
|
|
commit-message: 'Update message catalogs'
|
|
branch: bot/pull-translations
|
|
title: Update message catalogs
|