-
-
Notifications
You must be signed in to change notification settings - Fork 465
107 lines (105 loc) · 3.84 KB
/
docs-localization-download.yml
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
101
102
103
104
105
106
107
name: Multilingual Docs Download
on:
workflow_dispatch:
jobs:
download:
permissions: write-all
name: "Download localizations from Crowdin"
runs-on: ubuntu-latest
outputs:
pr_ref: pull/${{ steps.crowdin.outputs.pull_request_number }}/head
pr_url: ${{ steps.crowdin.outputs.pull_request_url }}
pr_id: ${{ steps.crowdin.outputs.pull_request_number }}
steps:
- uses: actions/checkout@v4
- name: "Install Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "requirements/_locale.txt"
- name: "Install Dependencies"
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements/_locale.txt
pip install .[speed,voice,docs]
- name: "Get locales"
run: |
make html
sphinx-build -b gettext . ./build/locales
working-directory: ./docs
- name: "Build locales"
run:
sphinx-intl update -p ./build/locales -l de -l ja -l de -l ja -l fr -l it -l
hi -l ko -l pt_BR -l es -l zh_CN -l ru -l en
working-directory: ./docs
- name: "Crowdin"
id: crowdin
uses: crowdin/github-action@v2
with:
upload_sources: false
upload_translations: false
download_translations: false
download_bundle: ${{ secrets.CROWDIN_BUNDLE_ID }}
localization_branch_name: l10n_master
create_pull_request: true
pull_request_title: "docs: Update localizations from Crowdin"
pull_request_body:
"Crowdin download was triggered due to completely translated file or
project. Starting sync. CC @Lulalaby"
pull_request_base_branch_name: "master"
pull_request_reviewers: "Lulalaby"
config: "crowdin.yml"
base_path: "."
commit_message: "docs: Update localizations from Crowdin"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
pr:
permissions: write-all
name: "Trigger PR workflows manually"
needs: [download]
runs-on: ubuntu-latest
steps:
- name: Invoke checks workflow
uses: benc-uk/[email protected]
with:
workflow: check.yml
ref: ${{ needs.download.outputs.pr_ref }}
- name: Invoke codeql workflow
uses: benc-uk/[email protected]
with:
workflow: codeql-analysis.yml
ref: ${{ needs.download.outputs.pr_ref }}
- name: Invoke lint workflow
uses: benc-uk/[email protected]
with:
workflow: lint.yml
ref: ${{ needs.download.outputs.pr_ref }}
- name: Invoke pr workflow
uses: benc-uk/[email protected]
with:
workflow: pr.yml
ref: ${{ needs.download.outputs.pr_ref }}
- name: Invoke test workflow
uses: benc-uk/[email protected]
with:
workflow: test.yml
ref: ${{ needs.download.outputs.pr_ref }}
- name: Invoke todo workflow
uses: benc-uk/[email protected]
with:
workflow: todo.yml
ref: ${{ needs.download.outputs.pr_ref }}
- name: Invoke version updates workflow
uses: benc-uk/[email protected]
with:
workflow: version-updates.yml
ref: ${{ needs.download.outputs.pr_ref }}
- run: gh pr review --approve ${{ needs.download.outputs.pr_id }} -b "auto-approval for localization sync :3"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- run: gh pr merge --auto --squash ${{ needs.download.outputs.pr_id }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}