From 6ee30ea293028654e6e863147952ea0271ae3408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=ADguel=20=C3=81ngel=20Mulero=20Mart=C3=ADnez?= Date: Thu, 8 Dec 2022 14:32:36 +0100 Subject: [PATCH] Add action to upload messages file to Crowdin (#3121) --- .github/workflows/nightly.yml | 5 ++++ .github/workflows/translations-pr.yml | 2 +- .github/workflows/translations-upload.yml | 29 +++++++++++++++++++++++ crowdin.yml | 4 ++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/translations-upload.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 73a27bbb..f1a206dc 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -27,6 +27,11 @@ jobs: with: debug_build: true + upload-translations: + name: Upload translations + needs: ci + uses: ./.github/workflows/translations-upload.yml + release: name: Nightly release needs: ci diff --git a/.github/workflows/translations-pr.yml b/.github/workflows/translations-pr.yml index 36b4c719..56597f8c 100644 --- a/.github/workflows/translations-pr.yml +++ b/.github/workflows/translations-pr.yml @@ -23,12 +23,12 @@ jobs: project_id: ${{ secrets.CROWDIN_PROJECT_ID }} token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} config: 'crowdin.yml' + crowdin_branch_name: ${{ github.ref_name }} upload_sources: false upload_translations: false download_translations: true - crowdin_branch_name: master download_translations_args: '-l ca -l da -l de -l es-ES -l eu -l fr -l gl -l hr -l hu -l id -l it -l ja -l ko -l lv -l nl -l pt-PT -l pt-BR -l pl -l ru -l sv-SE -l zh-CN -l zh-TW' localization_branch_name: update_translations_crowdin push_translations: true diff --git a/.github/workflows/translations-upload.yml b/.github/workflows/translations-upload.yml new file mode 100644 index 00000000..f7f065df --- /dev/null +++ b/.github/workflows/translations-upload.yml @@ -0,0 +1,29 @@ +name: Translations upload to Crowdin + +on: + workflow_call: + workflow_dispatch: + +jobs: + betaflight-messages-to-crowdin: + name: Messages file to Crowdin + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Upload messages file + uses: crowdin/github-action@1.5.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + project_id: ${{ secrets.CROWDIN_PROJECT_ID }} + token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + config: 'crowdin.yml' + crowdin_branch_name: ${{ github.ref_name }} + + upload_sources: true + upload_translations: false + + download_translations: false + diff --git a/crowdin.yml b/crowdin.yml index 4157d239..793c0ce8 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,3 +1,7 @@ +# ID used by the upload action to Crowdin +project_id_env: CROWDIN_PROJECT_ID +api_token_env: CROWDIN_PERSONAL_TOKEN + # # Files configuration #