forked from xrootd/xrootd
-
Notifications
You must be signed in to change notification settings - Fork 0
205 lines (171 loc) · 5.57 KB
/
python.yml
File metadata and controls
205 lines (171 loc) · 5.57 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Python
permissions:
contents: read
on:
push:
paths:
- setup.py
- pyproject.toml
- 'python/**'
- .github/workflows/python.yml
tags-ignore:
pull_request:
paths:
- setup.py
- pyproject.toml
- 'python/**'
workflow_dispatch:
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
sdist:
name: Source distribution
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install Python build dependencies
run: python -m pip install build
- name: Build source distribution tarball
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
./genversion.sh >| VERSION
python -m build --sdist
- name: Upload source distribution
uses: actions/upload-artifact@v7
with:
name: python-sdist
path: dist/*.tar.gz
retention-days: 14
manylinux:
name: Python ${{ matrix.version }} (Linux, ${{ matrix.platform.arch }})
runs-on: ${{ matrix.platform.runs_on }}
container: ${{ matrix.platform.container }}
needs: [ sdist ]
strategy:
fail-fast: false
matrix:
version: [ "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]
platform:
- arch: arm64
runs_on: ubuntu-24.04-arm
container: quay.io/pypa/manylinux_2_28_aarch64
- arch: x86_64
runs_on: ubuntu-24.04
container: quay.io/pypa/manylinux_2_28_x86_64
env:
CMAKE_ARGS: -DCMAKE_BUILD_TYPE=Release
PYTHON: python${{ matrix.version }}
steps:
- name: Install dependencies
run: dnf install -y git krb5-devel libuuid-devel openssl-devel
- name: Download source distribution
uses: actions/download-artifact@v7
with:
name: python-sdist
- name: Build binary wheel
run: ${PYTHON} -m pip wheel --use-pep517 --verbose *.tar.gz
- name: Fixup binary wheel
run: auditwheel repair *.whl
- name: Install binary wheel
run: ${PYTHON} -m pip install wheelhouse/*.whl
- name: Run post-installation tests
run: |
command -v ${PYTHON} && ${PYTHON} --version
${PYTHON} -m pip show xrootd
${PYTHON} -c 'import XRootD; print(XRootD)'
${PYTHON} -c 'import pyxrootd; print(pyxrootd)'
${PYTHON} -c 'from XRootD import client; help(client)'
${PYTHON} -c 'from XRootD import client; print(client.FileSystem("root://localhost"))'
- name: Upload Artifacts
uses: actions/upload-artifact@v7
with:
name: python-${{ matrix.version }}-linux-${{ matrix.platform.arch }}
path: wheelhouse
retention-days: 14
macos:
name: Python ${{ matrix.version }} (macOS, ${{ matrix.platform.arch }})
runs-on: ${{ matrix.platform.runs_on }}
needs: [ sdist ]
strategy:
fail-fast: false
matrix:
version: [ "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]
platform:
- arch: arm64
runs_on: macos-15
host_platform: macosx-15.0-arm64
openssl_prefix: /opt/homebrew/opt/openssl@3
- arch: x86_64
runs_on: macos-15-intel
host_platform: macosx-15.0-x86_64
openssl_prefix: /usr/local/opt/openssl@3
env:
CMAKE_ARGS: -DPython_FIND_UNVERSIONED_NAMES=FIRST -DCMAKE_BUILD_TYPE=Release
CMAKE_PREFIX_PATH: ${{ matrix.platform.openssl_prefix }}
HOMEBREW_NO_AUTO_UPDATE: "1"
MACOSX_DEPLOYMENT_TARGET: "15.0"
_PYTHON_HOST_PLATFORM: ${{ matrix.platform.host_platform }}
steps:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.version }}
- name: Install dependencies with Homebrew
run: brew install nlohmann-json
- name: Install Python build dependencies
run: python -m pip install build delocate
- name: Download source distribution
uses: actions/download-artifact@v7
with:
name: python-sdist
- name: Build binary wheel
run: python -m pip wheel --use-pep517 --verbose *.tar.gz
- name: Fixup binary wheel
run: delocate-wheel -w wheelhouse -v *.whl
- name: Install binary wheel
run: python -m pip install wheelhouse/*.whl
- name: Run post-installation tests
run: |
command -v python && python --version
python -m pip show xrootd
python -c 'import XRootD; print(XRootD)'
python -c 'import pyxrootd; print(pyxrootd)'
python -c 'from XRootD import client; help(client)'
python -c 'from XRootD import client; print(client.FileSystem("root://localhost"))'
- name: Upload Artifacts
uses: actions/upload-artifact@v7
with:
name: python-${{ matrix.version }}-macos-${{ matrix.platform.arch }}
path: wheelhouse
retention-days: 14
pypi:
if: ${{ github.event_name == 'release' && github.repository_owner == 'xrootd' }}
name: Publish to PyPI
needs: [ macos, manylinux ]
runs-on: ubuntu-latest
environment: pypi
permissions:
attestations: write
contents: read
id-token: write
steps:
- name: Download Artifacts
uses: actions/download-artifact@v7
with:
path: dist
pattern: python-*
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1