mirror of
https://github.com/OpenListTeam/OpenList-Frontend.git
synced 2026-03-15 03:20:25 +00:00
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:
36
.github/actions/sync_to_crowdin/action.yml
vendored
Normal file
36
.github/actions/sync_to_crowdin/action.yml
vendored
Normal 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 }}
|
||||
29
.github/workflows/i18n_sync.yml
vendored
29
.github/workflows/i18n_sync.yml
vendored
@@ -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
|
||||
|
||||
21
.github/workflows/manual_sync_to_crowdin.yml
vendored
Normal file
21
.github/workflows/manual_sync_to_crowdin.yml
vendored
Normal 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 }}
|
||||
Reference in New Issue
Block a user