From 650e4fb6b29c83a53c29e6fb1bef64bfee3f70a8 Mon Sep 17 00:00:00 2001 From: EYHN Date: Sat, 4 Jan 2025 20:32:21 +0800 Subject: [PATCH] chore(i18n): i18n auto codegen (#9516) --- .github/workflows/sync-i18n.yml | 34 +++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-i18n.yml b/.github/workflows/sync-i18n.yml index 277741dd63..ebb83c864b 100644 --- a/.github/workflows/sync-i18n.yml +++ b/.github/workflows/sync-i18n.yml @@ -11,7 +11,6 @@ on: jobs: synchronize-with-crowdin: runs-on: ubuntu-latest - permissions: contents: write pull-requests: write @@ -21,10 +20,11 @@ jobs: uses: actions/checkout@v4 - name: Crowdin action + id: crowdin uses: crowdin/github-action@v2 with: upload_sources: true - upload_translations: true + upload_translations: false download_translations: true auto_approve_imported: true import_eq_suggestions: true @@ -40,3 +40,33 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + i18n-codegen: + needs: synchronize-with-crowdin + runs-on: ubuntu-latest + + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: l10n_crowdin_translations + + - name: Setup Node.js + uses: ./.github/actions/setup-node + with: + electron-install: false + full-cache: true + + - name: Run i18n codegen + run: yarn affine @affine/i18n build + + - name: Commit changes + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "chore(i18n): i18n codegen" + git push origin l10n_crowdin_translations