@@ -2,12 +2,17 @@ name: Crowdin CI
2
2
3
3
on :
4
4
schedule :
5
- - cron : " 20 16 1 * *" # Runs at 4:20 PM on the first day of every month
5
+ - cron : " 20 4 1 * *" # Runs at 4:20 AM on the first day of every month
6
6
workflow_dispatch : # Can be dispatched manually
7
7
8
8
jobs :
9
9
create_approved_language_bucket_prs :
10
10
runs-on : ubuntu-latest
11
+ env :
12
+ CROWDIN_API_KEY : ${{ secrets.CROWDIN_API_KEY }}
13
+ CROWDIN_PROJECT_ID : ${{ secrets.CROWDIN_PROJECT_ID }}
14
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
15
+
11
16
steps :
12
17
# Set up environment
13
18
- name : Check out code
@@ -39,28 +44,17 @@ jobs:
39
44
# Build and prepare translations
40
45
- name : Build Crowdin project
41
46
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
47
46
- - name : Sleep while Crowdin build finishes
47
- run : sleep 3600 # in seconds (1 hour)
48
+ - name : Await latest build to finish
49
+ run : npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/awaitLatestBuild.ts
48
50
49
51
- name : Get latest translation bucket directory ids
50
52
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
53
55
54
# Import approved translations
56
55
- name : Get translations
57
56
run : npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/getTranslations.ts
58
- env :
59
- CROWDIN_API_KEY : ${{ secrets.CROWDIN_API_KEY }}
60
- CROWDIN_PROJECT_ID : ${{ secrets.CROWDIN_PROJECT_ID }}
61
57
62
58
# Post updates as language-specific PRs
63
59
- name : Process commits and post PRs by language
64
60
run : npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/postLangPRs.ts
65
- env :
66
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments