1
- name : Import Crowdin translations
1
+ name : Crowdin CI
2
2
3
3
on :
4
4
schedule :
5
5
- cron : " 20 16 1 * *" # Runs at 4:20 PM on the first day of every month
6
- workflow_dispatch :
6
+ workflow_dispatch : # Can be dispatched manually
7
7
8
8
jobs :
9
- create_pr :
9
+ create_approved_language_bucket_prs :
10
10
runs-on : ubuntu-latest
11
11
steps :
12
+ # Set up environment
12
13
- name : Check out code
13
14
uses : actions/checkout@v3
14
15
@@ -31,16 +32,34 @@ jobs:
31
32
- name : Fetch latest dev
32
33
run : git fetch origin dev
33
34
35
+ - name : Authenticate GitHub CLI
36
+ run : |
37
+ echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
38
+
39
+ # Build and prepare translations
40
+ - name : Build Crowdin project
41
+ run : npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/triggerBuild.ts
42
+ env :
43
+ CROWDIN_API_KEY : ${{ secrets.CROWDIN_API_KEY }}
44
+ CROWDIN_PROJECT_ID : ${{ secrets.CROWDIN_PROJECT_ID }}
45
+
46
+ - name : Sleep while Crowdin build finishes
47
+ run : sleep 3600 # in seconds (1 hour)
48
+
49
+ - name : Get latest translation bucket directory ids
50
+ run : npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/getBucketDirectoryIds.ts
51
+ env :
52
+ CROWDIN_API_KEY : ${{ secrets.CROWDIN_API_KEY }}
53
+ CROWDIN_PROJECT_ID : ${{ secrets.CROWDIN_PROJECT_ID }}
54
+
55
+ # Import approved translations
34
56
- name : Get translations
35
57
run : npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/getTranslations.ts
36
58
env :
37
59
CROWDIN_API_KEY : ${{ secrets.CROWDIN_API_KEY }}
38
60
CROWDIN_PROJECT_ID : ${{ secrets.CROWDIN_PROJECT_ID }}
39
61
40
- - name : Authenticate GitHub CLI
41
- run : |
42
- echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
43
-
62
+ # Post updates as language-specific PRs
44
63
- name : Process commits and post PRs by language
45
64
run : npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/postLangPRs.ts
46
65
env :
0 commit comments