From 2a0ddb1353936ce3bff695858e2c7a123df043ca Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 4 Nov 2021 13:02:06 -0700 Subject: [PATCH 1/4] Updating the Crowdin update process --- .github/workflows/build.yml | 40 +++++++++++++++++++ .../{crowdin-sync.yml => crowdin-pull.yml} | 0 crowdin.yml | 3 ++ 3 files changed, 43 insertions(+) rename .github/workflows/{crowdin-sync.yml => crowdin-pull.yml} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79dcc8f98a..40c10a274e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -167,6 +167,41 @@ jobs: if-no-files-found: error + crowdin-push: + name: Crowdin Push + runs-on: ubuntu-20.04 + needs: + - build + env: + _CROWDIN_PROJECT_ID: "268134" + steps: + - name: Checkout repo + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + + - name: Login to Azure + uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a + with: + creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }} + + - name: Retrieve secrets + id: retrieve-secrets + uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403 + with: + keyvault: "bitwarden-prod-kv" + secrets: "crowdin-api-token" + + - name: Upload Sources + uses: crowdin/github-action@e39093fd75daae7859c68eded4b43d42ec78d8ea # v1.3.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }} + with: + config: crowdin.yml + crowdin_branch_name: master + upload_sources: true + upload_translations: false + + check-failures: name: Check for failures if: always() @@ -176,6 +211,7 @@ jobs: - setup - locales-test - build + - crowdin-push steps: - name: Check if any job failed if: ${{ (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/rc') }} @@ -184,6 +220,7 @@ jobs: SETUP_STATUS: ${{ needs.setup.result }} LOCALES_TEST_STATUS: ${{ needs.locales-test.result }} BUILD_STATUS: ${{ needs.build.result }} + CROWDIN_PUSH_STATUS: ${{ needs.crowdin-push.result }} run: | if [ "$CLOC_STATUS" = "failure" ]; then exit 1 @@ -193,7 +230,10 @@ jobs: exit 1 elif [ "$BUILD_STATUS" = "failure" ]; then exit 1 + elif [ "$CROWDIN_PUSH_STATUS" = "failure" ]; then + exit 1 fi + - name: Login to Azure - Prod Subscription uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a if: failure() diff --git a/.github/workflows/crowdin-sync.yml b/.github/workflows/crowdin-pull.yml similarity index 100% rename from .github/workflows/crowdin-sync.yml rename to .github/workflows/crowdin-pull.yml diff --git a/crowdin.yml b/crowdin.yml index 4aa8bb7bad..2d33523535 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,7 +1,9 @@ project_id_env: _CROWDIN_PROJECT_ID api_token_env: CROWDIN_API_TOKEN +preserve_hierarchy: true files: - source: /src/_locales/en/messages.json + dest: /src/_locales/en/%original_file_name% translation: /src/_locales/%two_letters_code%/%original_file_name% update_option: update_as_unapproved languages_mapping: @@ -13,6 +15,7 @@ files: en-GB: en_GB en-IN: en_IN - source: /store/locales/en/copy.resx + dest: /store/locales/en/%original_file_name% translation: /store/locales/%two_letters_code%/%original_file_name% update_option: update_as_unapproved languages_mapping: From c97ff022b3cb494399c2e172e8a1b7c2e3504e54 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 4 Nov 2021 13:04:24 -0700 Subject: [PATCH 2/4] constraining the the crowdin push to the master branch --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40c10a274e..e79b465d1f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -169,6 +169,7 @@ jobs: crowdin-push: name: Crowdin Push + if: github.ref = 'refs/heads/master' runs-on: ubuntu-20.04 needs: - build From 8c1c0fd832bdcffc78a2301a2424fb91fc43c306 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 4 Nov 2021 13:04:59 -0700 Subject: [PATCH 3/4] fixing syntax issue --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e79b465d1f..de5b4be582 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -169,7 +169,7 @@ jobs: crowdin-push: name: Crowdin Push - if: github.ref = 'refs/heads/master' + if: github.ref == 'refs/heads/master' runs-on: ubuntu-20.04 needs: - build From a9e523ac9f2fd3aa2c55b998169cd23d0af90c84 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Thu, 4 Nov 2021 13:09:20 -0700 Subject: [PATCH 4/4] scheduling the crowdin pull for every friday --- .github/workflows/crowdin-pull.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/crowdin-pull.yml b/.github/workflows/crowdin-pull.yml index 9d3eaacf90..e534e20379 100644 --- a/.github/workflows/crowdin-pull.yml +++ b/.github/workflows/crowdin-pull.yml @@ -4,8 +4,8 @@ name: Crowdin Sync on: workflow_dispatch: inputs: {} -# schedule: -# - cron: '0 0 * * *' + schedule: + - cron: '0 0 * * 5' jobs: crowdin-sync: