Merge pull request #2159 from bitwarden/feature/crowdin-push

Updating Crowdin Sync Process
This commit is contained in:
Joseph Flinn 2021-11-05 10:59:27 -07:00 committed by GitHub
commit 194e8ea828
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 2 deletions

View File

@ -167,6 +167,42 @@ jobs:
if-no-files-found: error if-no-files-found: error
crowdin-push:
name: Crowdin Push
if: github.ref == 'refs/heads/master'
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: check-failures:
name: Check for failures name: Check for failures
if: always() if: always()
@ -176,6 +212,7 @@ jobs:
- setup - setup
- locales-test - locales-test
- build - build
- crowdin-push
steps: steps:
- name: Check if any job failed - name: Check if any job failed
if: ${{ (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/rc') }} if: ${{ (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/rc') }}
@ -184,6 +221,7 @@ jobs:
SETUP_STATUS: ${{ needs.setup.result }} SETUP_STATUS: ${{ needs.setup.result }}
LOCALES_TEST_STATUS: ${{ needs.locales-test.result }} LOCALES_TEST_STATUS: ${{ needs.locales-test.result }}
BUILD_STATUS: ${{ needs.build.result }} BUILD_STATUS: ${{ needs.build.result }}
CROWDIN_PUSH_STATUS: ${{ needs.crowdin-push.result }}
run: | run: |
if [ "$CLOC_STATUS" = "failure" ]; then if [ "$CLOC_STATUS" = "failure" ]; then
exit 1 exit 1
@ -193,7 +231,10 @@ jobs:
exit 1 exit 1
elif [ "$BUILD_STATUS" = "failure" ]; then elif [ "$BUILD_STATUS" = "failure" ]; then
exit 1 exit 1
elif [ "$CROWDIN_PUSH_STATUS" = "failure" ]; then
exit 1
fi fi
- name: Login to Azure - Prod Subscription - name: Login to Azure - Prod Subscription
uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
if: failure() if: failure()

View File

@ -4,8 +4,8 @@ name: Crowdin Sync
on: on:
workflow_dispatch: workflow_dispatch:
inputs: {} inputs: {}
# schedule: schedule:
# - cron: '0 0 * * *' - cron: '0 0 * * 5'
jobs: jobs:
crowdin-sync: crowdin-sync:

View File

@ -1,7 +1,9 @@
project_id_env: _CROWDIN_PROJECT_ID project_id_env: _CROWDIN_PROJECT_ID
api_token_env: CROWDIN_API_TOKEN api_token_env: CROWDIN_API_TOKEN
preserve_hierarchy: true
files: files:
- source: /src/_locales/en/messages.json - source: /src/_locales/en/messages.json
dest: /src/_locales/en/%original_file_name%
translation: /src/_locales/%two_letters_code%/%original_file_name% translation: /src/_locales/%two_letters_code%/%original_file_name%
update_option: update_as_unapproved update_option: update_as_unapproved
languages_mapping: languages_mapping:
@ -13,6 +15,7 @@ files:
en-GB: en_GB en-GB: en_GB
en-IN: en_IN en-IN: en_IN
- source: /store/locales/en/copy.resx - source: /store/locales/en/copy.resx
dest: /store/locales/en/%original_file_name%
translation: /store/locales/%two_letters_code%/%original_file_name% translation: /store/locales/%two_letters_code%/%original_file_name%
update_option: update_as_unapproved update_option: update_as_unapproved
languages_mapping: languages_mapping: