translations #1593
This file contains 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: translations | |
on: | |
schedule: | |
- cron: '23 2 * * *' | |
jobs: | |
pull_translations: | |
name: Pull translations from Transifex | |
runs-on: ubuntu-22.04 | |
container: | |
image: ubuntu:jammy | |
steps: | |
- uses: supplypike/setup-bin@v3 | |
with: | |
uri: https://github.com/transifex/cli/releases/download/v1.6.7/tx-linux-amd64.tar.gz | |
name: tx | |
version: 1.6.7 | |
- name: Install dependencies | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: > | |
apt-get update && apt-get install -y | |
git | |
ssh | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: git hackery | |
run: git config --global --add safe.directory ${GITHUB_WORKSPACE} | |
- name: Switch to master | |
run: git checkout master | |
- name: tx init | |
env: | |
TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
run: tx init | |
- name: tx config | |
env: | |
TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
run: tx add --organization davidsansome --project clementine --resource clementineplayer --file-filter 'src/translations/<lang>.po' --type PO src/translations/en.po | |
- name: tx pull | |
env: | |
TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
run: tx pull -f -a | |
- name: Setup git SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.TX_KEY }} | |
- name: git add | |
run: git add src/translations/* | |
- name: git commit and push | |
env: | |
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no" | |
run: | | |
[ -z "$(git status --porcelain)" ] || git -c 'user.name=Clementine Buildbot' -c '[email protected]' commit -m 'Automatic merge of translations from Transifex' && git push '[email protected]:clementine-player/Clementine.git' master |