diff --git a/.github/scripts/build.sh b/.github/scripts/build.sh index 4e9b1556c..46c229e10 100755 --- a/.github/scripts/build.sh +++ b/.github/scripts/build.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +set -u set -o pipefail error() { @@ -14,4 +15,4 @@ cd cpython/Doc || exit 1 mkdir -p locales/"$LOCALE"/ ln -sfn "$(realpath ../../docs)" locales/"$LOCALE"/LC_MESSAGES pip3 install -q -r requirements.txt -sphinx-build -b dummy -d build/doctrees -j auto -D language=$LOCALE -D gettext_compact=0 -W --keep-going -W . build/html 2> >(error) \ No newline at end of file +sphinx-build -b dummy -d build/doctrees -j auto -D language=$LOCALE -D gettext_compact=0 -E --keep-going -W . build/html 2> >(error) diff --git a/.github/scripts/generate_tx_config.py b/.github/scripts/generate_tx_config.py index ca3bb39e4..ebcc3b2dd 100755 --- a/.github/scripts/generate_tx_config.py +++ b/.github/scripts/generate_tx_config.py @@ -59,6 +59,10 @@ def patch_config(path: str): cwd = os.getcwd() os.chdir(path) config_content = FILTER_PATTERN.sub(name_replacer, config_content) + config_content = re.sub(r'replace_edited_strings.*\n','', config_content) + config_content = re.sub(r'keep_translations.*\n','', config_content) + config_content = re.sub(r'0\ntrans\.zh_CN.*\n','0\n', config_content) + config_content = config_content.replace(' =','=') os.chdir(cwd) tx_config_path.write_text(config_content, "utf-8") diff --git a/.github/scripts/update.sh b/.github/scripts/update.sh index 4a15d3095..0f2231d9f 100755 --- a/.github/scripts/update.sh +++ b/.github/scripts/update.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -u + cd cpython || exit 1 # Restore git timestamp for enabling build cache diff --git a/.github/workflows/python-310.yml b/.github/workflows/python-310.yml index 6607518d7..35a148f47 100644 --- a/.github/workflows/python-310.yml +++ b/.github/workflows/python-310.yml @@ -1,11 +1,12 @@ name: python-310 on: + workflow_dispatch: push: branches: - master schedule: - - cron: "26 * * * *" + - cron: "22 * * * *" jobs: sync: diff --git a/.github/workflows/python-311.yml b/.github/workflows/python-311.yml index 9566d743f..4fa85bb77 100644 --- a/.github/workflows/python-311.yml +++ b/.github/workflows/python-311.yml @@ -1,11 +1,12 @@ name: python-311 on: + workflow_dispatch: push: branches: - master schedule: - - cron: "38 * * * *" + - cron: "32 * * * *" jobs: sync: diff --git a/.github/workflows/python-312.yml b/.github/workflows/python-312.yml index d1bb99d95..75cc1d35e 100644 --- a/.github/workflows/python-312.yml +++ b/.github/workflows/python-312.yml @@ -1,16 +1,17 @@ name: python-312 on: + workflow_dispatch: push: branches: - master schedule: - - cron: "50 * * * *" + - cron: "42 * * * *" jobs: sync: uses: ./.github/workflows/sync.yml with: version: "3.12" - tx_project: "python-newest" + tx_project: "python-312" secrets: inherit diff --git a/.github/workflows/python-313.yml b/.github/workflows/python-313.yml new file mode 100644 index 000000000..5cf9c8340 --- /dev/null +++ b/.github/workflows/python-313.yml @@ -0,0 +1,17 @@ +name: python-313 + +on: + workflow_dispatch: + push: + branches: + - master + schedule: + - cron: "52 * * * *" + +jobs: + sync: + uses: ./.github/workflows/sync.yml + with: + version: "3.13" + tx_project: "python-313" + secrets: inherit diff --git a/.github/workflows/python-314.yml b/.github/workflows/python-314.yml new file mode 100644 index 000000000..9118a8ce8 --- /dev/null +++ b/.github/workflows/python-314.yml @@ -0,0 +1,17 @@ +name: python-314 + +on: + workflow_dispatch: + push: + branches: + - master + schedule: + - cron: "2 * * * *" + +jobs: + sync: + uses: ./.github/workflows/sync.yml + with: + version: "3.14" + tx_project: "python-newest" + secrets: inherit diff --git a/.github/workflows/python-38.yml b/.github/workflows/python-38.yml index 4da2959f9..9d0bc6daf 100644 --- a/.github/workflows/python-38.yml +++ b/.github/workflows/python-38.yml @@ -1,11 +1,6 @@ name: python-38 -on: - push: - branches: - - master - schedule: - - cron: "2 * * * *" +on: workflow_dispatch jobs: sync: diff --git a/.github/workflows/python-39.yml b/.github/workflows/python-39.yml index 3d6e5da9a..39305f585 100644 --- a/.github/workflows/python-39.yml +++ b/.github/workflows/python-39.yml @@ -1,11 +1,12 @@ name: python-39 on: + workflow_dispatch: push: branches: - master schedule: - - cron: "14 * * * *" + - cron: "12 * * * *" jobs: sync: diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 3fed1aca7..0788a37c0 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -20,14 +20,14 @@ jobs: LOCALE: zh_CN VERSION: ${{ inputs.version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout CPython - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: 'python/cpython' ref: ${{env.VERSION}} path: cpython - - uses: actions/cache/restore@v3 + - uses: actions/cache/restore@v4 with: path: | cpython/Doc/build @@ -35,7 +35,7 @@ jobs: key: cache-${{ inputs.version }}-${{ github.run_id }} restore-keys: cache-${{ inputs.version }}- - name: Checkout Current Branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{env.VERSION}} path: docs @@ -46,14 +46,14 @@ jobs: run: .github/scripts/update.sh env: TX_TOKEN: ${{ secrets.TRANSIFEX_APIKEY }} - - uses: actions/cache/restore@v3 + - uses: actions/cache/restore@v4 with: path: cpython/Doc/build key: cache-${{ inputs.version }}-${{ github.run_id }} restore-keys: cache-${{ inputs.version }}- - name: build run: .github/scripts/build.sh - - uses: actions/cache/save@v3 + - uses: actions/cache/save@v4 with: path: | cpython/Doc/build diff --git a/README.rst b/README.rst index 5c38d3110..f17ac8294 100644 --- a/README.rst +++ b/README.rst @@ -12,11 +12,21 @@ Maintained versions: * - Version - Sync status - Translation progress + * - `3.14 `_ + - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-314/badge.svg + :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-314 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.14%2F.stat.json&query=%24.translation&label=zh-CN + :target: https://app.transifex.com/python-doc/python-newest/ + * - `3.13 `_ + - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-313/badge.svg + :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-313 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.13%2F.stat.json&query=%24.translation&label=zh-CN + :target: https://app.transifex.com/python-doc/python-313/ * - `3.12 `_ - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-312/badge.svg :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-312 - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.12%2F.stat.json&query=%24.translation&label=zh-CN - :target: https://app.transifex.com/python-doc/python-newest/ + :target: https://app.transifex.com/python-doc/python-312/ * - `3.11 `_ - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-311/badge.svg :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-311 @@ -32,11 +42,6 @@ Maintained versions: :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-39 - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.9%2F.stat.json&query=%24.translation&label=zh-CN :target: https://app.transifex.com/python-doc/python-39/ - * - `3.8 `_ - - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-38/badge.svg - :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-38 - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.8%2F.stat.json&query=%24.translation&label=zh-CN - :target: https://app.transifex.com/python-doc/python-38/ EOL versions: @@ -46,6 +51,11 @@ EOL versions: * - Version - Sync status - Translation progress + * - `3.8 `_ + - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-38/badge.svg + :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-38 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.8%2F.stat.json&query=%24.translation&label=zh-CN + :target: https://app.transifex.com/python-doc/python-38/ * - `3.7 `_ - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-37/badge.svg :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-37