Repository navigation
90 lines (79 loc) · 3.02 KB
/
Copy pathupdate-tx-config.yml
File metadata and controls
90 lines (79 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Update Transifex Config
on:
workflow_dispatch:
inputs:
version:
description: 'Python version to update (or "all" for all versions)'
required: false
default: 'all'
type: choice
options:
- all
- "3.15"
- "3.14"
- "3.13"
- "3.12"
- "3.11"
- "3.10"
permissions:
contents: write
jobs:
update-config:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON('{"all":[{"version":"3.10","tx_project":"python-310"},{"version":"3.11","tx_project":"python-311"},{"version":"3.12","tx_project":"python-312"},{"version":"3.13","tx_project":"python-313"},{"version":"3.14","tx_project":"python-314"},{"version":"3.15","tx_project":"python-newest"}],"3.10":[{"version":"3.10","tx_project":"python-310"}],"3.11":[{"version":"3.11","tx_project":"python-311"}],"3.12":[{"version":"3.12","tx_project":"python-312"}],"3.13":[{"version":"3.13","tx_project":"python-313"}],"3.14":[{"version":"3.14","tx_project":"python-314"}],"3.15":[{"version":"3.15","tx_project":"python-newest"}]}')[inputs.version || 'all'] }}
steps:
- name: Checkout master
uses: actions/checkout@v6
- name: Checkout repository at version branch
uses: actions/checkout@v6
with:
ref: ${{ matrix.version }}
path: docs
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout CPython
uses: actions/checkout@v6
with:
repository: 'python/cpython'
ref: ${{ matrix.version }}
path: cpython
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Install Transifex CLI
run: |
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
sudo mv ./tx /usr/local/bin/tx
- name: Generate Transifex config
working-directory: docs
run: |
python ../.github/scripts/generate_tx_config.py \
--project-name "${{ matrix.tx_project }}" \
--doc-path "../cpython/Doc"
env:
TX_TOKEN: ${{ secrets.TRANSIFEX_APIKEY }}
- name: Check for changes
id: check_changes
working-directory: docs
run: |
if git diff --quiet .tx/config; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Configure git
if: steps.check_changes.outputs.has_changes == 'true'
working-directory: docs
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit and push changes
if: steps.check_changes.outputs.has_changes == 'true'
working-directory: docs
run: |
git add .tx/config
git commit -m "chore: update Transifex config for Python ${{ matrix.version }}"
git push