translations.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # SuperTux
  2. # Copyright (C) 2024 Tobias Markus
  3. #
  4. # This program is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU General Public License
  6. # as published by the Free Software Foundation; either version 3
  7. # of the License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. name: translations
  18. on:
  19. workflow_dispatch:
  20. schedule:
  21. - cron: '0 0 * * *'
  22. jobs:
  23. update-all-translations:
  24. runs-on: ubuntu-20.04
  25. steps:
  26. - name: Checkout SuperTux repository
  27. uses: actions/checkout@v4
  28. with:
  29. repository: 'SuperTux/supertux'
  30. fetch-depth: 1
  31. - name: Update translations
  32. env:
  33. TX_TOKEN: ${{ secrets.TRANSIFEX_TOKEN }}
  34. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  35. run: |
  36. # Installs transifex client:
  37. curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
  38. mv tx /usr/local/bin/tx
  39. # Pull repository:
  40. git fetch origin
  41. git checkout master
  42. git rebase origin/master
  43. # Pull translations:
  44. tx pull --use-git-timestamps -a -f
  45. # Commit
  46. git status
  47. git config --global user.email "SuperTux-bot@users.noreply.github.com"
  48. git config --global user.name "SuperTux Bot"
  49. git commit -am "Update translations" || true
  50. git push https://git:$GITHUB_TOKEN@github.com/SuperTux/supertux.git master