-
Notifications
You must be signed in to change notification settings - Fork 1.5k
146 lines (130 loc) · 4.54 KB
/
python_wheel_build.yml
File metadata and controls
146 lines (130 loc) · 4.54 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: 'ROOT Python wheels'
on:
workflow_dispatch:
inputs:
ref:
description: 'The git ref to build the wheel from (branch, tag, or commit SHA).'
type: string
required: true
default: ''
schedule:
- cron: '01 1 * * *'
pull_request:
types: [opened, synchronize, reopened, labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
build-wheels:
if: |
(github.repository_owner == 'root-project' &&
(github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch')) ||
contains(github.event.pull_request.labels.*.name, 'build-python-wheels')
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [cp310-manylinux_x86_64, cp311-manylinux_x86_64, cp312-manylinux_x86_64, cp313-manylinux_x86_64, cp314-manylinux_x86_64]
name: ${{ matrix.target }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.inputs.ref }}
- uses: ./.github/workflows/cibuildwheel-impl
with:
build-tag: ${{ matrix.target }}
test-wheels:
needs: build-wheels
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
name: test-wheel-cp${{ matrix.python-version }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.inputs.ref }}
- name: Download produced wheels
uses: actions/download-artifact@v4
with:
path: wheels
merge-multiple: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install produced wheel
run: |
ls -R wheels
PY_VER=$(python -c "import sys; print(f'cp{sys.version_info.major}{sys.version_info.minor}')")
WHEEL=$(ls wheels/*${PY_VER}*.whl | head -n 1)
echo "Python version: ${PY_VER}, installing wheel: ${WHEEL}"
pip install "$WHEEL"
- name: Install tutorials dependencies
run: |
python -m pip install --no-cache-dir -r test/wheels/requirements-ci.txt
- name: Run tutorials
run: |
pytest -vv --verbosity="4" -rF test/wheels
create-and-upload-wheel-registry:
if: github.event_name != 'pull_request' # The secrets are not available in PR
needs: build-wheels
runs-on: ubuntu-latest
steps:
- name: Download produced wheels
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Install required system packages
run: sudo apt-get install -y krb5-user xrootd-client
- name: Setup Python
uses: actions/setup-python@v5
- name: Create PEP503-compliant wheel registry
run: |
mkdir -p wheelhouse
mv *.whl wheelhouse
python -m pip install --upgrade pip
python -m pip install --user simple503
simple503 wheelhouse
- name: Compute number of files to upload
id: nfiles
run: echo "NFILES=$(find wheelhouse -maxdepth 1 | wc -l)" >> "$GITHUB_OUTPUT"
- name: Upload wheels to EOS
env:
RWEBEOS_KT: ${{ secrets.RWEBEOS_KT }}
KT_FILE_NAME: /tmp/decoded.keytab
EOS_PATH: /eos/project/r/root-eos/www/experimental-python-wheels
EOS_ENDPOINT: root://eosproject-r.cern.ch
KRB5CCNAME: /tmp/krb5cc
NFILES: ${{ steps.nfiles.outputs.NFILES }}
working-directory: ${{ env.WORKDIR }}
run: |
echo +++ Content
ls
echo +++ Retrieving the secret
echo ${RWEBEOS_KT} | base64 -d > ${KT_FILE_NAME}
echo +++ Creating the token
kinit -p ${{ secrets.KRB5USER }}@${{ secrets.KRB5REALM }} -kt ${KT_FILE_NAME}
echo +++ Running the copy
xrdcp --parallel ${NFILES} -rf wheelhouse/* ${EOS_ENDPOINT}/${EOS_PATH}/
publish-to-pypi:
if: github.event_name == 'workflow_dispatch'
needs: build-wheels
runs-on: ubuntu-latest
name: >-
Publish Python distribution to PyPI
environment:
name: pypi
url: https://pypi.org/p/root
permissions:
id-token: write
steps:
- name: Download produced wheels
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1