-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (38 loc) · 1.47 KB
/
build.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
name: Auto-Translate with Weblate
on:
push:
branches: [ main, test-build ]
jobs:
# runs on weblate commit
weblate-commit-build:
if: ${{ contains(github.event.head_commit.message, 'Translated using Weblate') }}
runs-on: ubuntu-latest
steps:
- name: TODO - start full build (delayed)
run: echo "TODO - start delayed full build, maybe 15mins?"
# on regular commit -> .pot/.po pushed by main repo
full-build:
if: ${{ ! contains(github.event.head_commit.message, 'Translated using Weblate') }}
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
runs-on: ubuntu-latest
env:
MAIN_LANGS: en
OTHER_LANGS: de es fr ru nl it ja el bg da et fi lv lt pl pt ro sv sk sl cs hu zh_CN
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Weblate - pull component repository
run: bash trigger_weblate.sh ${{ secrets.WEBLATE_API_URL }} none ${{ secrets.WEBLATE_TOKEN }} pull
- name: Weblate - force wait hoping for weblate to settle
run: sleep 180
- name: Weblate - trigger automated translations
shell: bash
run: |
for lang in $OTHER_LANGS
do
bash trigger_weblate.sh ${{ secrets.WEBLATE_API_URL }} $lang ${{ secrets.WEBLATE_TOKEN }} translate
done
- name: Weblate - push to upstream
run: bash trigger_weblate.sh ${{ secrets.WEBLATE_API_URL }} none ${{ secrets.WEBLATE_TOKEN }} push