Update translations #1810
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: "Update translations" | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 3 * * *" | |
| permissions: {} | |
| jobs: | |
| update-translations: | |
| permissions: | |
| # for git push | |
| contents: write | |
| strategy: | |
| matrix: | |
| # current transifex plan only allows 1 additional branch | |
| branch: ['master', '6'] | |
| runs-on: ubuntu-latest | |
| env: | |
| TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ssh-key: ${{ secrets.DEPLOYMENT_SSH_KEY }} | |
| submodules: recursive | |
| fetch-depth: 0 | |
| ref: ${{ matrix.branch }} | |
| - name: install-deps | |
| run: sudo apt install -y qt6-l10n-tools | |
| - name: l10n-remove-old | |
| run: | | |
| rm translations/*.ts | |
| git checkout translations/client_en.ts | |
| - name: l10n-read | |
| run: /usr/lib/qt6/bin/lupdate src -no-obsolete -ts translations/client_en.ts | |
| - name: l10n-push-source | |
| if: ${{ matrix.branch != 'master' }} | |
| uses: transifex/cli-action@v2 | |
| with: | |
| token: ${{ secrets.TX_TOKEN }} | |
| args: push -s --branch "${{ matrix.branch }}" | |
| - name: l10n-push-source | |
| if: ${{ matrix.branch == 'master' }} | |
| uses: transifex/cli-action@v2 | |
| with: | |
| token: ${{ secrets.TX_TOKEN }} | |
| args: push -s | |
| - name: fix-transifex-action | |
| run: rm -rf /tmp/tx | |
| - name: l10n-pull | |
| if: ${{ matrix.branch != 'master' }} | |
| uses: transifex/cli-action@v2 | |
| with: | |
| token: ${{ secrets.TX_TOKEN }} | |
| args: pull --force --all --silent --branch "${{ matrix.branch }}" | |
| - name: l10n-pull | |
| if: ${{ matrix.branch == 'master' }} | |
| uses: transifex/cli-action@v2 | |
| with: | |
| token: ${{ secrets.TX_TOKEN }} | |
| args: pull --force --all --silent | |
| - name: Push | |
| run: | | |
| git config user.name "ownClouders" | |
| git config user.email "devops@owncloud.com" | |
| git add translations | |
| if git diff --staged --quiet; then | |
| echo "No changes to commit" | |
| exit 0 | |
| fi | |
| git commit -m "[tx] updated translations from transifex" | |
| git push origin ${{ matrix.branch }} |