forked from ParadiseSS13/Paradise
-
Notifications
You must be signed in to change notification settings - Fork 124
62 lines (52 loc) · 1.73 KB
/
auto_translate.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
name: Add new translation
on:
workflow_dispatch:
push:
branches: ['translate']
concurrency:
group: translation
cancel-in-progress: false
jobs:
add_translation:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
name: 'Add new translation'
steps:
- name: 'Update Branch'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Installing Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Installing deps
run: |
python -m pip install --upgrade pip
pip install -r ./tools/translator/requirements.txt
- name: Create temporary branch
run: |
git checkout -b translate_tmp
git reset --hard origin/master
- name: Apply existing translation
run: |
git fetch origin translate
git checkout origin/translate -- ./tools/translator/ss220replace.json
./tools/translator/ss220_replacer_linux --prefix=ss220 --root=./../../ --location=./
- name: Apply PR translation
run: |
git cherry-pick -n origin/translate
- name: 'Generate Translation'
run: |
git add ./tools/translator/ss220replace.json
python ./tools/translator/converter.py
[ ! -f ./ss220replace.json ] || mv ./ss220replace.json ./tools/translator/ss220replace.json
git add ./tools/translator/ss220replace.json
- name: 'Push Translation'
run: |
git config --local user.email "[email protected]"
git config --local user.name "SS220Manager"
git commit -m "Generate translation file"
git push -f origin translate_tmp:translate