Skip to content

Commit

Permalink
Add action to upload messages file to Crowdin (#3121)
Browse files Browse the repository at this point in the history
  • Loading branch information
McGiverGim authored Dec 8, 2022
1 parent 402b732 commit 6ee30ea
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/translations-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/translations-upload.yml
Original file line number Diff line number Diff line change
@@ -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

4 changes: 4 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down

0 comments on commit 6ee30ea

Please sign in to comment.