From ce989b786fcd7da17234f8d645fe860bb9ac22e7 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Tue, 18 Jun 2024 20:10:08 +0530 Subject: [PATCH] [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 --- .github/workflows/auth-crowdin-push.yml | 31 +++++++++++++++++++ ...auth-crowdin.yml => auth-crowdin-sync.yml} | 9 +----- .github/workflows/mobile-crowdin-push.yml | 31 +++++++++++++++++++ ...le-crowdin.yml => mobile-crowdin-sync.yml} | 9 +----- ...din-push.yml => web-crowdin-push-both.yml} | 6 ++-- .../{web-crowdin.yml => web-crowdin-sync.yml} | 2 +- 6 files changed, 68 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/auth-crowdin-push.yml rename .github/workflows/{auth-crowdin.yml => auth-crowdin-sync.yml} (80%) create mode 100644 .github/workflows/mobile-crowdin-push.yml rename .github/workflows/{mobile-crowdin.yml => mobile-crowdin-sync.yml} (80%) rename .github/workflows/{web-crowdin-push.yml => web-crowdin-push-both.yml} (84%) rename .github/workflows/{web-crowdin.yml => web-crowdin-sync.yml} (97%) diff --git a/.github/workflows/auth-crowdin-push.yml b/.github/workflows/auth-crowdin-push.yml new file mode 100644 index 0000000000..5c81291012 --- /dev/null +++ b/.github/workflows/auth-crowdin-push.yml @@ -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 }} diff --git a/.github/workflows/auth-crowdin.yml b/.github/workflows/auth-crowdin-sync.yml similarity index 80% rename from .github/workflows/auth-crowdin.yml rename to .github/workflows/auth-crowdin-sync.yml index 7efdf3649c..be486b8dee 100644 --- a/.github/workflows/auth-crowdin.yml +++ b/.github/workflows/auth-crowdin-sync.yml @@ -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: diff --git a/.github/workflows/mobile-crowdin-push.yml b/.github/workflows/mobile-crowdin-push.yml new file mode 100644 index 0000000000..2c77ebc69b --- /dev/null +++ b/.github/workflows/mobile-crowdin-push.yml @@ -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 }} diff --git a/.github/workflows/mobile-crowdin.yml b/.github/workflows/mobile-crowdin-sync.yml similarity index 80% rename from .github/workflows/mobile-crowdin.yml rename to .github/workflows/mobile-crowdin-sync.yml index e52f005308..a6fbc42a14 100644 --- a/.github/workflows/mobile-crowdin.yml +++ b/.github/workflows/mobile-crowdin-sync.yml @@ -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: diff --git a/.github/workflows/web-crowdin-push.yml b/.github/workflows/web-crowdin-push-both.yml similarity index 84% rename from .github/workflows/web-crowdin-push.yml rename to .github/workflows/web-crowdin-push-both.yml index 694fa651c7..f836537b01 100644 --- a/.github/workflows/web-crowdin-push.yml +++ b/.github/workflows/web-crowdin-push-both.yml @@ -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 ` + # `gh workflow run web-crowdin-push-both.yml --ref ` workflow_dispatch: jobs: - push-to-crowdin: + push-both-to-crowdin: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/web-crowdin.yml b/.github/workflows/web-crowdin-sync.yml similarity index 97% rename from .github/workflows/web-crowdin.yml rename to .github/workflows/web-crowdin-sync.yml index ebfa9b03da..978f24b271 100644 --- a/.github/workflows/web-crowdin.yml +++ b/.github/workflows/web-crowdin-sync.yml @@ -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: