-
-
Notifications
You must be signed in to change notification settings - Fork 640
69 lines (61 loc) · 2.02 KB
/
i18n-bot-download.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
# This workflow runs every Saturday @ 1900 UTC (NOON PST)
name: i18n download bot
on:
workflow_dispatch:
schedule:
- cron: "0 19 * * 6"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout DIM
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.I18N_PAT }}
- uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: pnpm
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
- name: Download updated i18n files
uses: crowdin/github-action@v1.20.4
with:
upload_sources: false
upload_translations: false
download_translations: true
create_pull_request: false
push_translations: false
source: src/locale/en.json
translation: src/locale/%android_code%.json
project_id: ${{ secrets.CROWDIN_PROJECT_ID }}
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: sort locale json
run: |
allLocales=("en" "de" "es" "esMX" "fr" "it" "ja" "ko" "pl" "ptBR" "ru" "zhCHS" "zhCHT")
for lang in ${allLocales[@]}; do
jq -S . src/locale/$lang.json > src/locale/sorted_$lang.json && mv src/locale/sorted_$lang.json src/locale/$lang.json
done
- name: build browsercheck utils
run: pnpm bcu
- name: porcelain check
uses: dorny/paths-filter@v3
id: filter
with:
base: HEAD
filters: |
changed:
- '**'
- name: Commit files
if: steps.filter.outputs.changed
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: i18n
commit_user_name: DIM i18n Bot
commit_user_email: destinyitemmanager@gmail.com
commit_author: DIM i18n Bot <destinyitemmanager@gmail.com>