|
| 1 | +name: Sync Check with Upstream |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 3 * * 1' # jeden Montag um 3 Uhr nachts |
| 6 | + workflow_dispatch: # manuell auslösbar über GitHub-Weboberfläche |
| 7 | + |
| 8 | +jobs: |
| 9 | + check-sync: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + version: ['3.14', '3.15'] |
| 15 | + steps: |
| 16 | + - name: Translation-Repo auschecken |
| 17 | + uses: actions/checkout@v4 |
| 18 | + with: |
| 19 | + ref: ${{ matrix.version }} |
| 20 | + |
| 21 | + - name: Passenden CPython-Branch auschecken |
| 22 | + uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + repository: python/cpython |
| 25 | + ref: ${{ matrix.version }} |
| 26 | + path: cpython-src |
| 27 | + |
| 28 | + - name: Python + Sphinx einrichten |
| 29 | + run: | |
| 30 | + python3 -m venv cpython-src/Doc/venv |
| 31 | + cpython-src/Doc/venv/bin/pip install sphinx blurb |
| 32 | +
|
| 33 | + - name: Frische POT-Dateien bauen |
| 34 | + run: | |
| 35 | + cd cpython-src/Doc |
| 36 | + PATH="./venv/bin:$PATH" make gettext |
| 37 | +
|
| 38 | + - name: msgmerge gegen alle .po-Dateien laufen lassen |
| 39 | + run: | |
| 40 | + for pot in $(find cpython-src/Doc/build/gettext -name "*.pot"); do |
| 41 | + rel="${pot#cpython-src/Doc/build/gettext/}" |
| 42 | + po="${rel%.pot}.po" |
| 43 | + if [ -f "$po" ]; then |
| 44 | + msgmerge --quiet --update "$po" "$pot" |
| 45 | + fi |
| 46 | + done |
| 47 | +
|
| 48 | + - name: Prüfen, ob sich etwas geändert hat |
| 49 | + id: check |
| 50 | + run: | |
| 51 | + if git diff --quiet; then |
| 52 | + echo "changed=false" >> "$GITHUB_OUTPUT" |
| 53 | + else |
| 54 | + echo "changed=true" >> "$GITHUB_OUTPUT" |
| 55 | + fi |
| 56 | +
|
| 57 | + - name: PR mit den Aktualisierungen erstellen |
| 58 | + if: steps.check.outputs.changed == 'true' |
| 59 | + uses: peter-evans/create-pull-request@v6 |
| 60 | + with: |
| 61 | + branch: sync-upstream-${{ matrix.version }} |
| 62 | + base: ${{ matrix.version }} |
| 63 | + title: "Sync mit Upstream-Änderungen (${{ matrix.version }})" |
| 64 | + body: | |
| 65 | + Automatisch erkannte Änderungen im englischen Original-Quelltext. |
| 66 | + Neue `fuzzy`-Markierungen und fehlende Strings bitte manuell prüfen. |
| 67 | + commit-message: "Sync mit Upstream-Änderungen (${{ matrix.version }})" |
0 commit comments