[meta] Split translation related workflows

1. Sources uploaded anytime the {mobile,auth}/lib/l10n/arb/app_en.arb changes in main.
2. Tuesday morning: Download translations from crowdin.

Step 2 can be done manually by running the workflows, e.g.

    gh workflow run auth-crowdin-push.yml
    gh workflow run mobile-crowdin-push.yml
This commit is contained in:
Manav Rathi
2024-06-18 20:10:08 +05:30
parent 8a9d196282
commit ce989b786f
6 changed files with 68 additions and 20 deletions

31
.github/workflows/auth-crowdin-push.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: "Push sources to Crowdin (auth)"
on:
push:
branches: [main]
paths:
# Run workflow when auth's intl_en.arb is changed
- "auth/lib/l10n/arb/app_en.arb"
# Or the workflow itself is changed
- ".github/workflows/auth-crowdin.yml"
jobs:
push-sources-to-crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Crowdin's action
uses: crowdin/github-action@v2
with:
base_path: "auth/"
config: "auth/crowdin.yml"
upload_sources: true
upload_translations: false
download_translations: false
project_id: 575169
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

View File

@@ -1,17 +1,10 @@
name: "Sync Crowdin translations (auth)"
on:
push:
branches: [main]
paths:
# Run workflow when auth's intl_en.arb is changed
- "mobile/lib/l10n/arb/app_en.arb"
# Or the workflow itself is changed
- ".github/workflows/auth-crowdin.yml"
schedule:
# See: [Note: Run workflow on specific days of the week]
- cron: "50 1 * * 2"
# Also allow manually running the workflow
# Also allow manually running the workflow.
workflow_dispatch:
jobs:

View File

@@ -0,0 +1,31 @@
name: "Push sources to Crowdin (mobile)"
on:
push:
branches: [main]
paths:
# Run workflow when mobiles's intl_en.arb is changed
- "mobile/lib/l10n/intl_en.arb"
# Or the workflow itself is changed
- ".github/workflows/mobile-crowdin.yml"
jobs:
push-sources-to-crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Crowdin's action
uses: crowdin/github-action@v2
with:
base_path: "mobile/"
config: "mobile/crowdin.yml"
upload_sources: true
upload_translations: false
download_translations: false
project_id: 574741
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

View File

@@ -1,17 +1,10 @@
name: "Sync Crowdin translations (mobile)"
on:
push:
branches: [main]
paths:
# Run workflow when mobiles's intl_en.arb is changed
- "mobile/lib/l10n/intl_en.arb"
# Or the workflow itself is changed
- ".github/workflows/mobile-crowdin.yml"
schedule:
# See: [Note: Run workflow on specific days of the week]
- cron: "40 1 * * 2"
# Also allow manually running the workflow
# Also allow manually running the workflow.
workflow_dispatch:
jobs:

View File

@@ -1,6 +1,6 @@
name: "Push Crowdin translations (web)"
# This is a variant of web-crowdin.yml that uploads the translated strings in
# This is a variant of web-crowdin-sync.yml that uploads the translated strings in
# addition to the source strings.
#
# This allows us to change the strings in our source code for an automated
@@ -9,11 +9,11 @@ name: "Push Crowdin translations (web)"
on:
# Trigger manually, or using
# `gh workflow run web-crowdin-push.yml --ref <my-branch>`
# `gh workflow run web-crowdin-push-both.yml --ref <my-branch>`
workflow_dispatch:
jobs:
push-to-crowdin:
push-both-to-crowdin:
runs-on: ubuntu-latest
steps:

View File

@@ -17,7 +17,7 @@ on:
#
# See also: [Note: Run workflow every 24 hours]
- cron: "20 1 * * 2"
# Also allow manually running the workflow
# Also allow manually running the workflow.
workflow_dispatch:
jobs: