From b539e4a9b218ac4c4d3c732bcc3d9a6c2e829075 Mon Sep 17 00:00:00 2001 From: sy-records <52o@qq52o.cn> Date: Fri, 24 May 2024 13:32:48 +0800 Subject: [PATCH 1/2] ci: add crowdin --- .github/.github/crowdin/crowdin.yml | 11 +++++++++ .github/workflows/crowdin.yml | 38 +++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/.github/crowdin/crowdin.yml create mode 100644 .github/workflows/crowdin.yml diff --git a/.github/.github/crowdin/crowdin.yml b/.github/.github/crowdin/crowdin.yml new file mode 100644 index 0000000..77aeadb --- /dev/null +++ b/.github/.github/crowdin/crowdin.yml @@ -0,0 +1,11 @@ +files: + - source: /*.md + translation: /%two_letters_code%/%original_file_name% + ignore: + - '/_coverpage.md' + - '/_navbar.md' + translation_replace: + "zh": '' + +project_id_env: CROWDIN_PROJECT_ID +api_token_env: CROWDIN_PERSONAL_TOKEN diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml new file mode 100644 index 0000000..a9686d3 --- /dev/null +++ b/.github/workflows/crowdin.yml @@ -0,0 +1,38 @@ +name: Crowdin Action + +on: + workflow_dispatch: + schedule: + - cron: '0 */12 * * *' + +permissions: + contents: write + pull-requests: write + +jobs: + synchronize-with-crowdin: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: crowdin action + uses: crowdin/github-action@v1 + with: + upload_sources: false + upload_translations: false + download_translations: true + download_language: zh-CN + download_translations_args: --all + localization_branch_name: l10n_crowdin_${{ github.ref_name }}_translations + create_pull_request: true + crowdin_branch_name: ${{ github.ref_name }} + pull_request_team_reviewers: 'docs-zh' + pull_request_base_branch_name: ${{ github.ref_name }} + base_path: ${{ github.workspace }} + config: '.github/crowdin/crowdin.yml' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} From d13191569b763ffdc28581b21a4380c592d669ed Mon Sep 17 00:00:00 2001 From: Luffy <52o@qq52o.cn> Date: Thu, 8 May 2025 16:41:09 +0800 Subject: [PATCH 2/2] ci: update crowdin action to v2 and adjust config path --- .github/{.github/crowdin/crowdin.yml => crowdin/config.yml} | 0 .github/workflows/crowdin.yml | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/{.github/crowdin/crowdin.yml => crowdin/config.yml} (100%) diff --git a/.github/.github/crowdin/crowdin.yml b/.github/crowdin/config.yml similarity index 100% rename from .github/.github/crowdin/crowdin.yml rename to .github/crowdin/config.yml diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index a9686d3..7aacee9 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: crowdin action - uses: crowdin/github-action@v1 + uses: crowdin/github-action@v2 with: upload_sources: false upload_translations: false @@ -31,7 +31,7 @@ jobs: pull_request_team_reviewers: 'docs-zh' pull_request_base_branch_name: ${{ github.ref_name }} base_path: ${{ github.workspace }} - config: '.github/crowdin/crowdin.yml' + config: 'crowdin/config.yml' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}