From 7a776eb7f60f9c0426a07ace3ec82a58ecc7344d Mon Sep 17 00:00:00 2001 From: icarus Date: Thu, 4 Sep 2025 17:27:26 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E7=BF=BB=E8=AF=91=E7=9A=84=20GitHub?= =?UTF-8?q?=20Actions=20=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-i18n.yml | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/auto-i18n.yml diff --git a/.github/workflows/auto-i18n.yml b/.github/workflows/auto-i18n.yml new file mode 100644 index 0000000000..4fa13c1437 --- /dev/null +++ b/.github/workflows/auto-i18n.yml @@ -0,0 +1,37 @@ +name: Auto I18N + +env: + API_KEY: ${{ secrets.TRANSLATE_API_KEY}} + MODEL: ${{ vars.MODEL || 'deepseek/deepseek-v3.1'}} + BASE_URL: ${{ vars.BASE_URL || 'https://api.ppinfra.com/openai'}} + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + auto-i18n: + runs-on: ubuntu-latest + name: Auto I18N + + steps: + - name: 🐈‍⬛ Checkout + uses: actions/checkout@v5 + + - name: 📦 Setting Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: 📦 Dependencies + run: npm install openai cli-progress tsx + + - name: 🏃‍♀️ Translate + run: tsx scripts/update-i18n.ts + + - name: 🚀 Push changes + uses: ad-m/git-push@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: main