feat(ci): optimize CI workflows and i18n translation system (#204) #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto I18n Translation | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "messages/en-US.json" | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| translate: | |
| name: Auto Translation | |
| runs-on: ubuntu-latest | |
| if: ${{ github.repository == 'ifLabX/AgentifUI' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: "9" | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "18" | |
| cache: "pnpm" | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Clean extra keys and run full translation | |
| run: | | |
| echo "🧹 Cleaning extra keys..." | |
| pnpm i18n:remove-extra || true | |
| echo "🤖 Starting translation..." | |
| pnpm i18n:translate | |
| echo "✅ Validating translations..." | |
| pnpm i18n:check || true | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: auto-i18n-updates | |
| delete-branch: true | |
| title: "chore(i18n): auto-update translations" | |
| body: | | |
| ## 🤖 Automated Translation Update | |
| Auto-generated translations based on changes to `messages/en-US.json`. | |
| **Triggered by**: Push to main branch | |
| **Languages**: All supported languages | |
| **Mode**: Full translation update | |
| Please review the translations and merge when ready. | |
| labels: | | |
| i18n | |
| automated | |
| commit-message: | | |
| chore(i18n): auto-update translations | |
| Auto-generated by GitHub Actions |