update workflows #4
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: Generate Translation Files | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| min_version: | ||
| description: 'Minimum Minecraft version (client-side; 1.19.4 = earliest vb.* key support)' | ||
| required: true | ||
| default: '1.21.4' | ||
| type: string | ||
| max_version: | ||
| description: 'Maximum Minecraft version (server-side; leave blank to auto-detect from mappings)' | ||
| required: false | ||
| default: '' | ||
| type: string | ||
| workflow_call: | ||
| inputs: | ||
| min_version: | ||
| required: true | ||
| type: string | ||
| max_version: | ||
| required: false | ||
| type: string | ||
| secrets: | ||
| GITHUB_TOKEN: | ||
| required: true | ||
| jobs: | ||
| build-langs: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v7 | ||
| - name: Checkout ViaVersion/Mappings repository | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| repository: 'ViaVersion/Mappings' | ||
| path: 'Mappings' | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.13' | ||
| - name: Run Lang Generator Script | ||
| env: | ||
| MAPPINGS_DIR: ${{ github.workspace }}/Mappings/mappings | ||
| MIN_VERSION: ${{ inputs.min_version || github.event.inputs.min_version }} | ||
| MAX_VERSION: ${{ inputs.max_version || github.event.inputs.max_version }} | ||
| run: python .github/scripts/generate_langs.py | ||
| - name: Commit and push changes | ||
| run: | | ||
| git config --global user.name "github-actions[bot]" | ||
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
| git add assets/minecraft/lang/*.json | ||
| git diff --staged --quiet || git commit -m "chore: auto-generate translation files" | ||
| git push | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||