pip: bump docutils from 0.17.1 to 0.19 #837
Workflow file for this run
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
name: Update | |
on: | |
workflow_dispatch: | |
inputs: | |
BRANCH: | |
description: CPython branch to use | |
required: false | |
type: string | |
default: '3.11' | |
push: | |
paths: | |
- '.github/workflows/update.yml' | |
- 'Makefile' | |
branches: | |
- '3.11' | |
- '3.10' | |
- '3.9' | |
- '3.8' | |
- '3.7' | |
schedule: | |
- cron: '0 23 * * *' | |
permissions: | |
contents: read | |
jobs: | |
# Download translations from Transifex, keep PO and Logs artifacts | |
pull: | |
name: Pull from Transifex | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out ${{ github.repository }} | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Extract branch name | |
if: github.event != 'workflow_dispatch' | |
shell: bash | |
run: echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_ENV | |
- name: ... or set branch name if manually run | |
if: github.event == 'workflow_dispatch' | |
run: echo "BRANCH=${{ github.event.inputs.BRANCH }}" >> $GITHUB_ENV | |
- name: Check out CPython | |
uses: actions/checkout@v3 | |
with: | |
repository: python/cpython | |
ref: ${{ env.BRANCH }} | |
path: cpython | |
- name: Set up Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3' | |
cache: 'pip' | |
cache-dependency-path: | | |
'requirements.txt' | |
'${{ env.CPYTHON_DIR }}/requirements.txt' | |
- name: Install dependencies | |
run: sudo apt update -y && sudo apt install gettext tree -y | |
- name: Pull translations | |
run: make pull TX_CLI_DIR=/usr/local/bin | |
env: | |
TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
- name: Upload artifact - po files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: translations | |
path: | | |
*.po | |
**/*.po | |
.tx/ | |
- name: Upload artifact - log files | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pull-logs | |
path: logs/* | |
# Job for getting po files downloaded and storing this repository | |
push: | |
if: github.repository == 'python/python-docs-pt-br' | |
name: Push to repo | |
needs: [pull] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Check out ${{ github.repository }} | |
uses: actions/checkout@v3 | |
- name: Download PO files | |
uses: actions/download-artifact@v3 | |
with: | |
name: translations | |
- name: Changed files | |
run: git status | |
- name: Commit and push changes | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
make push | |
# Merge translations previously updated into older branches to make sure | |
# older versions of Python Docs gets translated as well. | |
# 'overwrite=true' means strings previously translated will get overwritten; | |
# other branches will preserve translated strings, only filling in new | |
# translations. | |
merge: | |
name: Merge into ${{ matrix.branch }} | |
needs: [push] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
max-parallel: 3 | |
matrix: | |
branch: ['3.10', '3.9', '3.8', '3.7', '3.6', '2.7'] | |
include: | |
- branch: 3.10 | |
overwrite: true | |
steps: | |
- name: Get current branch name | |
shell: bash | |
run: | |
echo "CURRENT_BRANCH=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV | |
- name: Check out source branch (${{ env.CURRENT_BRANCH }}) | |
uses: actions/checkout@v3 | |
with: | |
path: ${{ env.CURRENT_BRANCH }} | |
persist-credentials: false | |
- name: Check out target branch (${{ matrix.branch }}) | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ matrix.branch }} | |
path: ${{ matrix.branch }} | |
- name: Set up Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3' | |
cache: 'pip' | |
cache-dependency-path: "${{ env.CURRENT_BRANCH }}/requirements.txt" | |
- name: Install dependencies | |
run: | | |
sudo apt update -y && sudo apt install gettext -y | |
pip3 install pomerge powrap | |
- name: Merge overwriting on stable release branch | |
if: ${{ matrix.overwrite == true }} | |
run: | | |
pomerge --from ${{ env.CURRENT_BRANCH }}/**/*.po --to ${{ matrix.branch }}/**/*.po | |
- name: Merge without overwriting on EOL or security-fix release branch | |
if: ${{ matrix.overwrite != true }} | |
run: | | |
pomerge --no-overwrite --from ${{ env.CURRENT_BRANCH }}/**/*.po --to ${{ matrix.branch }}/**/*.po | |
- name: Wrap catalog message files | |
run: | | |
powrap --modified -C ${{ matrix.branch }} | |
#TODO: Solve make push to work with merge scenario | |
- name: Commit and push changes | |
if: github.repository == 'python/python-docs-pt-br' | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git diff -I'^"POT-Creation-Date: ' --numstat *.po **/*.po | cut -f3 | xargs -r git add | |
git add $(git ls-files -o --exclude-standard *.po **/*.po) .tx/config | |
git commit --allow-empty -m "Merge ${{ env.CURRENT_BRANCH }} into ${{ matrix.branch }}" | |
working-directory: ${{ matrix.branch }} | |
# Call the check.yml workflow after updating to run some tests | |
call-build: | |
name: call | |
needs: pull | |
uses: ./.github/workflows/check.yml | |
secrets: inherit |