Update translations #8
This file contains hidden or 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
# Modification along rffontenelle/python-docs-pt-br | |
name: Update translations | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '40 23 * * *' | |
#push: | |
# paths: | |
# - '.github/workflows/update.yml' | |
# - 'scripts/update.sh' | |
# branches: | |
# - '3.11' | |
env: | |
CPYTHON_BRANCH: '3.14' | |
LANGUAGE: 'ja' | |
jobs: | |
update: | |
# Job to pull translation from Transifex platform, and commit & push changes | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out ${{ github.repository }} | |
uses: actions/checkout@v4 | |
- name: Check out CPython | |
uses: actions/checkout@v4 | |
with: | |
repository: python/cpython | |
persist-credentials: false | |
ref: ${{ env.CPYTHON_BRANCH }} | |
path: cpython | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
cache: 'pip' | |
cache-dependency-path: '**/requirements*.txt' | |
- name: Install Transifex CLI | |
run: | | |
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash | |
working-directory: /usr/local/bin | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y && sudo apt-get install gettext -y | |
pip install --upgrade pip | |
pip install -r requirements.txt -r cpython/Doc/requirements.txt | |
- name: Update translations | |
run: | | |
sh scripts/update.sh | |
env: | |
TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
LANGUAGE: ${{ env.LANGUAGE }} | |
- name: Wrap catalog message files | |
run: | | |
powrap --modified | |
git diff | |
- name: Commit and push changes | |
if: github.repository == 'python/python-docs-ja' | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git status | |
git add -A | |
git diff-index --quiet HEAD || ( git commit -m "Update translations from Transifex" && git push ) | |
merge: | |
needs: [update] | |
uses: ./.github/workflows/merge.yml |