Use sphinx-build -b gettext instead of patch in ci.yml (#2) #24
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: true | |
submodules: true | |
- name: Update submodule | |
run: | | |
git submodule update | |
cd peps && git fetch origin && git checkout main && git reset --hard origin | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
cache-dependency-path: | | |
requirements.txt | |
peps/requirements.txt | |
- name: Install gettext | |
run: | | |
sudo apt update -y && sudo apt install gettext -y | |
- name: Install Python dependencies | |
run: | | |
python -m pip install -U pip | |
pip install -r requirements.txt -r peps/requirements.txt | |
- name: Generate POT files | |
run: | | |
cd peps/peps && sphinx-build -E -b gettext -D gettext_compact=0 -d ../build/.doctrees . ../../locales/pot | |
- name: Add/Update message catalog files | |
run: | | |
cd peps/peps && sphinx-intl update -d ../../locales -p ../../locales/pot | |
- name: powrap | |
run: | | |
powrap --modified | |
- name: Commit and push changes | |
if: ${{ github.event_name == 'push' || | |
github.event_name == 'workflow_dispatch' }} | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "Translation update" | |
file_pattern: .gitmodules locales/**/*.po | |
add_options: '-A' |