-
Notifications
You must be signed in to change notification settings - Fork 3
72 lines (66 loc) · 2.52 KB
/
crowdin_sync.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
name: Crowdin Action
on:
workflow_dispatch:
inputs:
locales:
# Target languages https://developer.crowdin.com/language-codes/
default: '["ar", "cs", "de", "el", "es-ES", "et", "fa", "fi", "fil", "fr", "he", "hi", "hr", "id", "it", "ja", "ko", "lt", "ms", "nl", "no", "pl", "pt-PT", "pt-BR", "ro", "ru", "sk", "sl", "sv-SE", "th", "tr", "uk", "vi", "zh-CN", "zh-TW"]'
description: "Languages"
required: true
schedule:
- cron: '30 5,12,17 * * *'
push:
branches: [ main ]
paths:
- 'en/**'
jobs:
# ------------------------
set_locales:
runs-on: ubuntu-latest
outputs:
locales: ${{ steps.generate-matrix.outputs.locales }}
steps:
- name: Generate Matrix
id: generate-matrix
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
LOCALES='${{ inputs.locales }}'
else
LOCALES='["fr"]'
# LOCALES='["ar", "cs", "de", "el", "es-ES", "et", "fa", "fi", "fil", "fr", "he", "hi", "hr", "id", "it", "ja", "ko", "lt", "ms", "nl", "no", "pl", "pt-PT", "pt-BR", "ro", "ru", "sk", "sl", "sv-SE", "th", "tr", "uk", "vi", "zh-CN", "zh-TW"]'
fi
echo "locales=${LOCALES}" >> $GITHUB_OUTPUT
crowdin:
name: Synchronize with Crowdin
needs:
- set_locales
runs-on: ubuntu-latest
permissions: write-all
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
#GITHUB_TOKEN: ${{ secrets.GH_TOKEN_CROWDIN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
strategy:
fail-fast: false
max-parallel: 1 # Should be 1 to avoid parallel builds
matrix:
lc: ${{ fromJSON(needs.set_locales.outputs.locales) }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Matrix
uses: crowdin/github-action@v1
with:
upload_sources: true
upload_translations: false
download_translations: true
commit_message: New Crowdin translations - ${{ matrix.lc }}
localization_branch_name: l10n_main_${{ matrix.lc }}
pull_request_base_branch_name: 'main'
pull_request_title: New translations - ${{ matrix.lc }}
download_language: ${{ matrix.lc }}
#env:
#GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
#CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}