summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/integration.yml42
-rw-r--r--.github/workflows/l10n.yml136
-rw-r--r--.github/workflows/translations-update.yml59
3 files changed, 136 insertions, 101 deletions
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 9ca96bf69..eb4f458d7 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -47,48 +47,6 @@ jobs:
- name: Build themes
run: make themes.all
- babel:
- name: Update translations branch
- runs-on: ubuntu-24.04
- if: ${{ github.repository_owner == 'searxng' && github.ref == 'refs/heads/master' }}
- needs:
- - python
- - themes
- permissions:
- contents: write # for make V=1 weblate.push.translations
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: '0'
- token: ${{ secrets.WEBLATE_GITHUB_TOKEN }}
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: '3.12'
- architecture: 'x64'
- - name: Cache Python dependencies
- id: cache-python
- uses: actions/cache@v4
- with:
- path: |
- ./local
- ./.nvm
- ./node_modules
- key: python-ubuntu-20.04-3.12-${{ hashFiles('requirements*.txt', 'setup.py','.nvmrc', 'package.json') }}
- - name: weblate & git setup
- env:
- WEBLATE_CONFIG: ${{ secrets.WEBLATE_CONFIG }}
- run: |
- mkdir -p ~/.config
- echo "${WEBLATE_CONFIG}" > ~/.config/weblate
- git config --global user.email "searxng-bot@users.noreply.github.com"
- git config --global user.name "searxng-bot"
- - name: Update transations
- id: update
- run: |
- make V=1 weblate.push.translations
-
dockers:
name: Docker
if: github.ref == 'refs/heads/master'
diff --git a/.github/workflows/l10n.yml b/.github/workflows/l10n.yml
new file mode 100644
index 000000000..4220c5c65
--- /dev/null
+++ b/.github/workflows/l10n.yml
@@ -0,0 +1,136 @@
+---
+name: Translation
+
+# yamllint disable-line rule:truthy
+on:
+ workflow_dispatch:
+ workflow_run:
+ workflows:
+ - Integration
+ types:
+ - completed
+ branches:
+ - master
+ schedule:
+ - cron: "05 07 * * 5"
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref_name }}
+ cancel-in-progress: false
+
+permissions:
+ contents: read
+
+env:
+ PYTHON_VERSION: "3.13"
+
+jobs:
+ update:
+ if: github.repository_owner == 'searxng' && github.event.workflow_run.conclusion == 'success'
+ name: Update
+ runs-on: ubuntu-24.04-arm
+ permissions:
+ # For "make V=1 weblate.push.translations"
+ contents: write
+
+ steps:
+ - name: Setup Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: "${{ env.PYTHON_VERSION }}"
+
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ token: "${{ secrets.WEBLATE_GITHUB_TOKEN }}"
+ fetch-depth: "0"
+
+ - name: Setup cache Python
+ uses: actions/cache@v4
+ with:
+ key: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
+ restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
+ path: "./local/"
+
+ - name: Setup venv
+ run: make V=1 install
+
+ - name: Setup Weblate
+ run: |
+ mkdir -p ~/.config
+ echo "${{ secrets.WEBLATE_CONFIG }}" > ~/.config/weblate
+
+ - name: Setup Git
+ run: |
+ git config --global user.email "searxng-bot@users.noreply.github.com"
+ git config --global user.name "searxng-bot"
+
+ - name: Update translations
+ run: make V=1 weblate.push.translations
+
+ pr:
+ if: |
+ github.repository_owner == 'searxng'
+ && (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule')
+ name: Pull Request
+ runs-on: ubuntu-24.04-arm
+ permissions:
+ # For "make V=1 weblate.translations.commit"
+ contents: write
+ # For action "peter-evans/create-pull-request"
+ pull-requests: write
+
+ steps:
+ - name: Setup Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: "${{ env.PYTHON_VERSION }}"
+
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ token: "${{ secrets.WEBLATE_GITHUB_TOKEN }}"
+ fetch-depth: "0"
+
+ - name: Setup cache Python
+ uses: actions/cache@v4
+ with:
+ key: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
+ restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
+ path: "./local/"
+
+ - name: Setup venv
+ run: make V=1 install
+
+ - name: Setup Weblate
+ run: |
+ mkdir -p ~/.config
+ echo "${{ secrets.WEBLATE_CONFIG }}" > ~/.config/weblate
+
+ - name: Setup Git
+ run: |
+ git config --global user.email "searxng-bot@users.noreply.github.com"
+ git config --global user.name "searxng-bot"
+
+ - name: Merge and push translation updates
+ run: make V=1 weblate.translations.commit
+
+ - name: Create PR
+ id: cpr
+ uses: peter-evans/create-pull-request@v7
+ with:
+ author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
+ committer: "searxng-bot <searxng-bot@users.noreply.github.com>"
+ title: "[l10n] update translations from Weblate"
+ commit-message: "[l10n] update translations from Weblate"
+ branch: "translations_update"
+ delete-branch: "true"
+ draft: "false"
+ signoff: "false"
+ labels: |
+ translation
+
+ - name: Display information
+ run: |
+ echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
+ echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
diff --git a/.github/workflows/translations-update.yml b/.github/workflows/translations-update.yml
deleted file mode 100644
index 85e141e7f..000000000
--- a/.github/workflows/translations-update.yml
+++ /dev/null
@@ -1,59 +0,0 @@
-name: "Update translations"
-on: # yamllint disable-line rule:truthy
- schedule:
- - cron: "05 07 * * 5"
- workflow_dispatch:
-
-jobs:
- babel:
- name: "create PR for additions from weblate"
- runs-on: ubuntu-24.04
- if: ${{ github.repository_owner == 'searxng' && github.ref == 'refs/heads/master' }}
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: '0'
- token: ${{ secrets.WEBLATE_GITHUB_TOKEN }}
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: '3.12'
- architecture: 'x64'
- - name: Cache Python dependencies
- id: cache-python
- uses: actions/cache@v4
- with:
- path: |
- ./local
- ./.nvm
- ./node_modules
- key: python-ubuntu-24.04-3.12-${{ hashFiles('requirements*.txt', 'setup.py','.nvmrc', 'package.json') }}
- - name: weblate & git setup
- env:
- WEBLATE_CONFIG: ${{ secrets.WEBLATE_CONFIG }}
- run: |
- mkdir -p ~/.config
- echo "${WEBLATE_CONFIG}" > ~/.config/weblate
- git config --global user.email "searxng-bot@users.noreply.github.com"
- git config --global user.name "searxng-bot"
- - name: Merge and push transation updates
- run: |
- make V=1 weblate.translations.commit
- - name: Create Pull Request
- id: cpr
- uses: peter-evans/create-pull-request@v3
- with:
- token: ${{ secrets.WEBLATE_GITHUB_TOKEN }}
- commit-message: '[l10n] update translations from Weblate'
- committer: searxng-bot <searxng-bot@users.noreply.github.com>
- author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
- signoff: false
- branch: translations_update
- delete-branch: true
- draft: false
- title: '[l10n] update translations from Weblate'
- body: |
- update translations from Weblate
- labels: |
- translation