mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-08-29 10:21:34 +00:00
84 lines
2.3 KiB
YAML
84 lines
2.3 KiB
YAML
name: Crowdin Sync
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 6 * * *"
|
|
workflow_dispatch:
|
|
inputs:
|
|
branch:
|
|
description: "Branch to sync translations into"
|
|
required: false
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
crowdin:
|
|
runs-on: blacksmith-2vcpu-ubuntu-2404
|
|
steps:
|
|
- name: Resolve target branch
|
|
id: branch
|
|
run: |
|
|
BRANCH="${{ inputs.branch }}"
|
|
if [ -z "$BRANCH" ]; then
|
|
BRANCH="${{ github.event.repository.default_branch }}"
|
|
fi
|
|
echo "name=$BRANCH" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Checkout branch
|
|
uses: actions/checkout@v7
|
|
with:
|
|
ref: ${{ steps.branch.outputs.name }}
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GHCR_TOKEN }}
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: ".nvmrc"
|
|
|
|
- name: Upload sources to Crowdin
|
|
uses: crowdin/github-action@v2
|
|
with:
|
|
upload_sources: true
|
|
upload_translations: false
|
|
download_translations: false
|
|
create_pull_request: false
|
|
push_translations: false
|
|
token: ${{ secrets.CROWDIN_API_KEY }}
|
|
project_id: "858252"
|
|
env:
|
|
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_KEY }}
|
|
|
|
- name: Machine pre-translate untranslated strings
|
|
env:
|
|
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
|
|
run: node scripts/crowdin-pretranslate.cjs
|
|
|
|
- name: Download translations from Crowdin
|
|
uses: crowdin/github-action@v2
|
|
with:
|
|
upload_sources: false
|
|
upload_translations: false
|
|
download_translations: true
|
|
create_pull_request: false
|
|
push_translations: false
|
|
token: ${{ secrets.CROWDIN_API_KEY }}
|
|
project_id: "858252"
|
|
env:
|
|
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_KEY }}
|
|
|
|
- name: Commit translations
|
|
run: |
|
|
git config user.name "LukeGus"
|
|
git config user.email "bugattiguy527@gmail.com"
|
|
|
|
git add src/ui/locales/translated
|
|
if git diff --cached --quiet; then
|
|
echo "No translation changes to commit."
|
|
exit 0
|
|
fi
|
|
git commit -m "chore: sync Crowdin translations"
|
|
git push origin HEAD:"${{ steps.branch.outputs.name }}"
|