FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-docs-ru/.github/workflows/transifex-pull.yml at main · python/python-docs-ru · GitHub
python
python-docs-ru
Repository navigation
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
python-docs-ru
/
.github
/
workflows
/
transifex-pull.yml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
83 lines (79 loc) · 3.45 KB
Breadcrumbs
python-docs-ru
/
.github
/
workflows
/
transifex-pull.yml
Copy path
File metadata and controls
83 lines (79 loc) · 3.45 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
name
:
Pull Translations from Transifex
on
:
schedule
:
-
cron
:
'
0 0 * * *
'
workflow_dispatch
:
permissions
:
contents
:
write
jobs
:
update-translation
:
runs-on
:
ubuntu-latest
strategy
:
fail-fast
:
false
matrix
:
version
:
[ '3.15', '3.14', '3.13', '3.12', '3.11' ]
steps
:
-
uses
:
styfle/cancel-workflow-action@main
with
:
access_token
:
${{ secrets.GITHUB_TOKEN }}
-
uses
:
actions/setup-python@master
with
:
python-version
:
'
3.12
'
-
name
:
Install Dependencies
run
:
|
set -euxo pipefail
sudo apt-get update
sudo apt-get install -y gettext curl tar
python -m pip install --upgrade pip
pip install requests cogapp polib transifex-python sphinx-intl blurb six
# Install tx deterministically with retries instead of piping installer script.
TX_URL="https://github.com/transifex/cli/releases/latest/download/tx-linux-amd64.tar.gz"
curl -fL --retry 5 --retry-delay 2 --retry-connrefused "$TX_URL" -o /tmp/tx.tar.gz
tar -xzf /tmp/tx.tar.gz -C /tmp
sudo install -m 0755 /tmp/tx /usr/local/bin/tx
command -v tx
tx --version
-
uses
:
actions/checkout@master
with
:
ref
:
${{ matrix.version }}
fetch-depth
:
0
-
run
:
curl -fL -o transifex-util.py https://raw.githubusercontent.com/python-docs-translations/transifex-automations/master/sample-workflows/transifex-util.py
-
run
:
chmod +x transifex-util.py
-
name
:
Patch helper for cross-version Doc Makefile compatibility
run
:
|
python - <<'PY'
from pathlib import Path
p = Path("transifex-util.py")
old = '_call("make -C cpython/Doc/ gettext")'
new = '_call("make -C cpython/Doc/ venv")\n _call("make -C cpython/Doc/ JOBS=1 gettext || make -C cpython/Doc/ JOBS=1 build BUILDER=gettext")'
s = p.read_text()
if old not in s:
raise SystemExit("Expected pattern was not found in transifex-util.py")
p.write_text(s.replace(old, new))
PY
-
run
:
./transifex-util.py recreate_tx_config --language ru --project-slug python-newest --version ${{ matrix.version }}
env
:
TX_TOKEN
:
${{ secrets.TX_TOKEN }}
-
run
:
./transifex-util.py fetch --language ru --pull-options="--mode reviewed" --project-slug python-newest --version ${{ matrix.version }}
env
:
TX_TOKEN
:
${{ secrets.TX_TOKEN }}
-
run
:
./transifex-util.py delete_obsolete_files --language ru --project-slug python-newest --version ${{ matrix.version }}
-
name
:
Set up Git
run
:
|
git config --local user.email github-actions@github.com
git config --local user.name "GitHub Action's update-translation job"
-
run
:
git add . ':!transifex-util.py'
-
name
:
Filter files
run
:
|
! git diff --cached -I'^"POT-Creation-Date: ' \
-I'^"Language-Team: ' \
-I'^# ' -I'^"Last-Translator: ' \
--exit-code \
&& echo "SIGNIFICANT_CHANGES=1" >> $GITHUB_ENV || exit 0
-
run
:
git commit -m 'Update translation from Transifex'
if
:
env.SIGNIFICANT_CHANGES == '1'
-
uses
:
ad-m/github-push-action@master
if
:
env.SIGNIFICANT_CHANGES == '1'
with
:
branch
:
${{ matrix.version }}
github_token
:
${{ secrets.GITHUB_TOKEN }}
Back
|
FazBrowse Home
|
New Git URL