-
Notifications
You must be signed in to change notification settings - Fork 55
48 lines (45 loc) · 1.48 KB
/
crowdin.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
name: Upload lang keys to Crowdin
on:
workflow_dispatch:
push:
branches:
- '1.[0-9]+'
- '1.[0-9]+.[0-9]+'
paths:
- 'src/main/resources/assets/vampirism/lang/en_us.json'
- 'src/main/resources/assets/vampirismguide/lang/en_us.json'
jobs:
upload-translations:
environment: Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: 'gradle'
- name: Determine Crowdin branch
id: get_crowdin_branch
run: |
version=$(./gradlew crowdinBranch -q)
if [[ $version =~ ^1\.[0-9]+$ ]]; then
echo "Crowdin branch: $version"
echo "crowdin_branch=$version" >> $GITHUB_OUTPUT
else
echo "Invalid version: $version"
exit 1
fi
- name: Upload translation keys
uses: crowdin/github-action@v1
with:
crowdin_branch_name: ${{ steps.get_crowdin_branch.outputs.crowdin_branch }}
env:
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
- name: Install Crowdin CLI
run: npm i -g @crowdin/cli
- name: Pre-translate
run: crowdin pre-translate -b ${{ steps.get_crowdin_branch.outputs.crowdin_branch }} --translate-with-perfect-match-only --translate-untranslated-only --method=tm
env:
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}