Skip to content

Commit 09afa29

Browse files
committed
ci: show diff after powrap
1 parent 96f7d3b commit 09afa29

File tree

2 files changed

+64
-49
lines changed

2 files changed

+64
-49
lines changed

.github/workflows/merge.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Merge translations
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
7+
env:
8+
CPYTHON_BRANCH: '3.14'
9+
LANGUAGE: 'ja'
10+
11+
jobs:
12+
merge:
13+
# Merge translations previously updated into older branches to make sure
14+
# older versions of Python Docs gets translated as well.
15+
name: merge into ${{ matrix.branch }}
16+
strategy:
17+
matrix:
18+
branch: [ "3.13", "3.12", "3.11" ]
19+
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Check out source branch (${{ env.CPYTHON_BRANCH }})
23+
uses: actions/checkout@v4
24+
with:
25+
path: ${{ env.CPYTHON_BRANCH }}
26+
27+
- name: Check out target branch (${{ matrix.branch }})
28+
uses: actions/checkout@v4
29+
with:
30+
ref: ${{ matrix.branch }}
31+
path: ${{ matrix.branch }}
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
cache: 'pip'
37+
cache-dependency-path: '**/requirements*.txt'
38+
39+
- name: Install dependencies
40+
run: |
41+
sudo apt-get update -y && sudo apt-get install gettext -y
42+
pip install pomerge powrap
43+
44+
- name: Merge overwriting on stable release branch
45+
run: |
46+
pomerge --from "${{ env.CPYTHON_BRANCH }}"/**/*.po --to "${{ matrix.branch }}"/**/*.po
47+
48+
- name: Wrap catalog message files
49+
run: |
50+
powrap --modified -C "${{ matrix.branch }}"
51+
cd "${{ matrix.branch }}" && git diff
52+
53+
- name: Commit and push changes
54+
if: github.repository == 'python/python-docs-ja'
55+
run: |
56+
cd "${{ matrix.branch }}"
57+
git config user.name github-actions
58+
git config user.email github-actions@github.com
59+
git status
60+
git add -A
61+
git diff-index --quiet HEAD || ( git commit -m "Merge ${{ env.CPYTHON_BRANCH }} into ${{ matrix.branch }}" && git push )
62+

.github/workflows/update.yml

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
- name: Wrap catalog message files
5454
run: |
5555
powrap --modified
56+
git diff
5657
- name: Commit and push changes
5758
if: github.repository == 'python/python-docs-ja'
5859
run: |
@@ -63,53 +64,5 @@ jobs:
6364
git diff-index --quiet HEAD || ( git commit -m "Update translations from Transifex" && git push )
6465
6566
merge:
66-
# Merge translations previously updated into older branches to make sure
67-
# older versions of Python Docs gets translated as well.
68-
name: merge into ${{ matrix.branch }}
6967
needs: [update]
70-
strategy:
71-
matrix:
72-
branch: [ "3.13", "3.12", "3.11" ]
73-
74-
runs-on: ubuntu-latest
75-
steps:
76-
- name: Check out source branch (${{ env.CPYTHON_BRANCH }})
77-
uses: actions/checkout@v4
78-
with:
79-
path: ${{ env.CPYTHON_BRANCH }}
80-
81-
- name: Check out target branch (${{ matrix.branch }})
82-
uses: actions/checkout@v4
83-
with:
84-
ref: ${{ matrix.branch }}
85-
path: ${{ matrix.branch }}
86-
87-
- name: Set up Python
88-
uses: actions/setup-python@v5
89-
with:
90-
cache: 'pip'
91-
cache-dependency-path: '**/requirements*.txt'
92-
93-
- name: Install dependencies
94-
run: |
95-
sudo apt-get update -y && sudo apt-get install gettext -y
96-
pip install pomerge powrap
97-
98-
- name: Merge overwriting on stable release branch
99-
run: |
100-
pomerge --from "${{ env.CPYTHON_BRANCH }}"/**/*.po --to "${{ matrix.branch }}"/**/*.po
101-
102-
- name: Wrap catalog message files
103-
run: |
104-
powrap --modified -C "${{ matrix.branch }}"
105-
106-
- name: Commit and push changes
107-
if: github.repository == 'python/python-docs-ja'
108-
run: |
109-
cd "${{ matrix.branch }}"
110-
git config user.name github-actions
111-
git config user.email github-actions@github.com
112-
git status
113-
git add -A
114-
git diff-index --quiet HEAD || ( git commit -m "Merge ${{ env.CPYTHON_BRANCH }} into ${{ matrix.branch }}" && git push )
115-
68+
uses: ./.github/workflows/merge.yml

0 commit comments

Comments
 (0)