From c8ab870b68a7ff49dd54bc6f18f788aaaf8f3b2f Mon Sep 17 00:00:00 2001 From: krmax44 Date: Mon, 15 Apr 2024 16:37:38 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20add=20translation=20ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/translations-pr.yml | 24 ++++++++++++++ .github/workflows/translations.yml | 45 +++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/workflows/translations-pr.yml create mode 100644 .github/workflows/translations.yml diff --git a/.github/workflows/translations-pr.yml b/.github/workflows/translations-pr.yml new file mode 100644 index 000000000..af2391205 --- /dev/null +++ b/.github/workflows/translations-pr.yml @@ -0,0 +1,24 @@ +name: Open translation PR + +on: + push: + branches: + - weblate + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +permissions: + pull-requests: write + +jobs: + translation-pr: + name: "Create Translation PR" + runs-on: ubuntu-latest + steps: + - name: create pull request + run: gh pr create -B main -H weblate --title 'Translations update from Weblate' --body '' --repo $GITHUB_REPOSITORY || true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml new file mode 100644 index 000000000..4d6f82d06 --- /dev/null +++ b/.github/workflows/translations.yml @@ -0,0 +1,45 @@ +name: Update translations + +on: + push: + branches: + - main + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +permissions: + contents: write + +jobs: + translations: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' + cache-dependency-path: | + setup.py + requirements.txt + - name: Install system-level dependencies + run: sudo apt-get update && sudo apt-get install libxml2-dev libxslt1-dev python3-dev libgdal-dev gdal-bin libmagic-dev libmagickwand-dev gettext libpoppler-cpp-dev + - name: Install dependencies + run: | + python -m pip install --upgrade pip pip-tools + pip-sync requirements.txt + pip install -e . + - name: Setup Git + run: | + git config user.name "fdsbot" + git config user.email "119665132+fdsbot@users.noreply.github.com" + - name: Compile translations + run: make messagesde + - name: Commit translations + run: | + git add **/django.po || true + git commit -m "💬 update translation messages" || true + git push -u origin main:weblate-source --force