ci(lang): manual sync to crowdin (#350)

* ci(lang): manual sync to crowdin

* fix

* ci: add sync to crowdin condition
This commit is contained in:
KirCute
2025-12-31 11:38:55 +08:00
committed by GitHub
parent e2321584e0
commit 5fe991d095
3 changed files with 62 additions and 24 deletions

View File

@@ -0,0 +1,36 @@
name: Sync i18n to Crowdin
inputs:
crowdin_project_id:
required: true
description: "Crowdin Project ID"
crowdin_personal_token:
required: true
description: "Crowdin Personal Token"
runs:
using: "composite"
steps:
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
# version: 9.9.0
run_install: false
- name: Install dependencies
shell: bash
run: pnpm install
- name: Sync to Crowdin
shell: bash
run: |
pnpm crowdin:upload
env:
CROWDIN_PROJECT_ID: ${{ inputs.crowdin_project_id }}
CROWDIN_PERSONAL_TOKEN: ${{ inputs.crowdin_personal_token }}

View File

@@ -83,31 +83,12 @@ jobs:
git push
fi
- name: Setup Node
if: steps.verify-changed-files.outputs.changed == 'true'
uses: actions/setup-node@v6
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- name: Install pnpm
if: steps.verify-changed-files.outputs.changed == 'true'
uses: pnpm/action-setup@v4
with:
# version: 9.9.0
run_install: false
- name: Install dependencies
if: steps.verify-changed-files.outputs.changed == 'true'
run: pnpm install
- name: Sync to Crowdin
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
pnpm crowdin:upload
env:
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
if: ${{ steps.verify-changed-files.outputs.changed == 'true' || github.event_name == 'push' }}
uses: ./.github/actions/sync_to_crowdin
with:
crowdin_project_id: ${{ secrets.CROWDIN_PROJECT_ID }}
crowdin_personal_token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
permissions:
contents: write

View File

@@ -0,0 +1,21 @@
name: Manual sync i18n to Crowdin
on:
workflow_dispatch:
jobs:
run_sync:
name: Run sync
runs-on: ubuntu-latest
steps:
- name: Checkout frontend codes
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Sync to Crowdin
uses: ./.github/actions/sync_to_crowdin
with:
crowdin_project_id: ${{ secrets.CROWDIN_PROJECT_ID }}
crowdin_personal_token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}