|
1 | | -name: Pull Translations |
| 1 | +name: Test Build Workflow |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | schedule: |
5 | | - - cron: '0 */6 * * *' |
| 5 | + - cron: '0 0 * * *' |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - '*' |
6 | 9 | workflow_dispatch: |
7 | 10 |
|
8 | 11 | jobs: |
9 | | - pull: |
| 12 | + build-translation: |
10 | 13 | runs-on: ubuntu-latest |
11 | | - |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + version: [ '3.14' ] |
| 18 | + format: [ html, latex, epub ] |
12 | 19 | steps: |
13 | | - - name: Checkout repository |
14 | | - uses: actions/checkout@v3 |
15 | | - |
16 | | - - name: Install Transifex client |
17 | | - run: | |
18 | | - python -m pip install --upgrade pip |
19 | | - pip install transifex-client |
20 | | -
|
21 | | - - name: Configure Transifex authentication |
22 | | - run: | |
23 | | - echo "[https://www.transifex.com]" > ~/.transifexrc |
24 | | - echo "api_hostname = https://api.transifex.com" >> ~/.transifexrc |
25 | | - echo "hostname = https://www.transifex.com" >> ~/.transifexrc |
26 | | - echo "username = api" >> ~/.transifexrc |
27 | | - echo "password = $TX_TOKEN" >> ~/.transifexrc |
28 | | - env: |
29 | | - TX_TOKEN: ${{ secrets.TX_TOKEN }} |
| 20 | + - uses: actions/setup-python@master |
| 21 | + with: |
| 22 | + python-version: 3.12 # pinned for Sphinx 3.4.3 to build 3.10 |
| 23 | + - uses: actions/checkout@master |
| 24 | + with: |
| 25 | + repository: python/cpython |
| 26 | + ref: ${{ matrix.version }} |
| 27 | + - run: make venv |
| 28 | + working-directory: ./Doc |
| 29 | + - uses: actions/checkout@master |
| 30 | + with: |
| 31 | + ref: ${{ matrix.version }} |
| 32 | + path: Doc/locales/XX/LC_MESSAGES |
| 33 | + - run: git pull |
| 34 | + working-directory: ./Doc/locales/XX/LC_MESSAGES |
| 35 | + - uses: sphinx-doc/github-problem-matcher@v1.1 |
| 36 | + - run: make -e SPHINXOPTS="--color -D language='XX' -W --keep-going" ${{ matrix.format }} |
| 37 | + working-directory: ./Doc |
| 38 | + - uses: actions/upload-artifact@master |
| 39 | + if: success() || failure() |
| 40 | + with: |
| 41 | + name: build-${{ matrix.version }}-${{ matrix.format }} |
| 42 | + path: Doc/build/${{ matrix.format }} |
30 | 43 |
|
31 | | - - name: Pull translations from Transifex |
32 | | - run: | |
33 | | - tx pull --all --force |
34 | | -
|
35 | | - - name: Commit and push changes |
36 | | - run: | |
37 | | - git config user.name "github-actions" |
38 | | - git config user.email "actions@github.com" |
39 | | - git add . |
40 | | - git commit -m "Auto pull translations" || echo "No changes" |
41 | | - git push |
| 44 | + output-pdf: |
| 45 | + runs-on: ubuntu-latest |
| 46 | + strategy: |
| 47 | + matrix: |
| 48 | + version: [ '3.14' ] |
| 49 | + needs: [ 'build-translation' ] |
| 50 | + steps: |
| 51 | + - uses: actions/download-artifact@master |
| 52 | + with: |
| 53 | + name: build-${{ matrix.version }}-latex |
| 54 | + - run: sudo apt-get update |
| 55 | + - run: sudo apt-get install -y latexmk texlive-xetex fonts-freefont-otf xindy |
| 56 | + - run: make |
| 57 | + - uses: actions/upload-artifact@master |
| 58 | + with: |
| 59 | + name: build-${{ matrix.version }}-pdf |
| 60 | + path: ./*.pdf |
0 commit comments