-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
100 lines (93 loc) · 2.92 KB
/
transifex.yml
File metadata and controls
100 lines (93 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Synchronise translations
on:
pull_request:
paths:
- ".github/workflows/transifex.yml"
- "utils/babel_runner.py"
schedule:
# 22:38 GMT, every Sunday. Chosen to be a random time.
- cron: "38 22 * * SUN"
workflow_dispatch:
permissions:
contents: read
env:
FORCE_COLOR: "1"
UV_SYSTEM_PYTHON: "1" # make uv do global installs
jobs:
push:
if: github.repository_owner == 'sphinx-doc'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3"
- name: Install transifex client
run: |
mkdir -p /tmp/tx_cli && cd $_
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
shell: bash
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install --group translations
- name: Extract translations from source code
run: python utils/babel_runner.py extract
- name: Push translations to transifex.com
run: |
cd sphinx/locale
/tmp/tx_cli/tx push --source --use-git-timestamps --workers 10
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
pull:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
if: github.repository_owner == 'sphinx-doc'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3"
- name: Install transifex client
run: |
mkdir -p /tmp/tx_cli && cd $_
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
shell: bash
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install --group translations
- name: Extract translations from source code
run: python utils/babel_runner.py extract
- name: Pull translations from transifex.com
run: |
cd sphinx/locale
/tmp/tx_cli/tx pull --translations --all --force --use-git-timestamps --workers 10
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Compile message catalogs
run: python utils/babel_runner.py compile
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
add-paths: |
sphinx/locale
commit-message: "[internationalisation] Update translations"
branch: bot/pull-translations
title: "[bot]: Update message catalogues"
labels: "internals:internationalisation"
body-path: babel_compile.txt