-
Notifications
You must be signed in to change notification settings - Fork 33
185 lines (173 loc) · 6.23 KB
/
Copy pathrelease.yml
File metadata and controls
185 lines (173 loc) · 6.23 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
name: Build and deploy
on:
workflow_dispatch:
release:
types:
- published
jobs:
build_sdist:
name: Build and test source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: '3.12'
cache: 'pip'
- run: python -m pip install --upgrade build mypy numpy pip ruff twine
- run: ruff format --check
- run: ruff check
- run: mypy
- run: python -m build --sdist
- run: python -m twine check dist/*
- run: pip install --pre "$(ls dist/hdf5plugin*.tar.gz)[test]"
- run: pip uninstall -y blosc2_grok # https://github.com/silx-kit/hdf5plugin/issues/377
- run: python test/test.py
- uses: actions/upload-artifact@v7
with:
path: dist/hdf5plugin-*.tar.gz
archive: false
build_doc:
name: Build documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "pip"
- run: sudo apt-get install pandoc
- run: pip install .[doc]
env:
HDF5PLUGIN_STRIP: all # Do not build the filters
- name: Build doc
run: |
export OUTPUT_NAME="hdf5plugin-$(python -c 'import hdf5plugin; print(hdf5plugin.version)')_documentation"
sphinx-build doc/ "${OUTPUT_NAME}/"
zip -r "${OUTPUT_NAME}.zip" "${OUTPUT_NAME}/"
- uses: actions/upload-artifact@v7
with:
path: hdf5plugin-*_documentation.zip
archive: false
build_wheels:
name: Build wheels on ${{ matrix.os }}-${{ matrix.cibw_archs }}
runs-on: ${{ matrix.os }}
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cibw_archs: "auto64"
with_sse2: true
- os: ubuntu-24.04-arm
cibw_archs: "auto64"
with_sse2: false
- os: ubuntu-latest
cibw_archs: "ppc64le"
with_sse2: false
- os: windows-latest
cibw_archs: "auto64"
with_sse2: true
- os: macos-15-intel
cibw_archs: "auto64"
with_sse2: true
- os: macos-14
cibw_archs: "auto64"
with_sse2: false
steps:
- uses: actions/checkout@v7
- uses: docker/setup-qemu-action@v4
if: runner.os == 'Linux' && runner.arch == 'X64'
with:
platforms: all
- uses: pypa/cibuildwheel@v4.1.0
env:
# Configure hdf5plugin build
HDF5PLUGIN_OPENMP: "False"
HDF5PLUGIN_NATIVE: "False"
HDF5PLUGIN_SSE2: ${{ matrix.with_sse2 && 'True' || 'False' }}
HDF5PLUGIN_SSSE3: "False"
HDF5PLUGIN_AVX2: "False"
HDF5PLUGIN_AVX512: "False"
HDF5PLUGIN_BMI2: "False"
HDF5PLUGIN_CPP11: "True"
HDF5PLUGIN_CPP14: "True"
HDF5PLUGIN_CPP20: "True"
MACOSX_DEPLOYMENT_TARGET: "10.13"
CIBW_ENVIRONMENT_PASS_LINUX: HDF5PLUGIN_OPENMP HDF5PLUGIN_NATIVE HDF5PLUGIN_SSE2 HDF5PLUGIN_SSSE3 HDF5PLUGIN_AVX2 HDF5PLUGIN_AVX512 HDF5PLUGIN_BMI2 HDF5PLUGIN_CPP11 HDF5PLUGIN_CPP14 HDF5PLUGIN_CPP20
CIBW_BUILD_VERBOSITY: 1
# Use Python3.12 to build wheels that are compatible with all supported version of Python
CIBW_BUILD: cp312-*
# Do not build for muslinux
CIBW_SKIP: "*-musllinux_*"
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_TEST_SKIP: "*-*linux_ppc64le"
CIBW_BEFORE_TEST: pip install packaging h5py --only-binary ":all:"
CIBW_TEST_COMMAND: python {project}/test/test.py
- uses: actions/upload-artifact@v7
with:
path: ./wheelhouse/hdf5plugin-*.whl
archive: false
test_wheels:
needs: [build_wheels]
name: Test wheel on ${{ matrix.os }}-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-15-intel, macos-14]
python-version: ['3.9', '3.14']
include:
- python-version: '3.9'
OLDEST_DEPENDENCIES: 'h5py==3.0.0 "numpy<2"'
- python-version: '3.9'
os: ubuntu-24.04-arm
OLDEST_DEPENDENCIES: 'h5py==3.6.0 "numpy<2"'
- python-version: '3.9'
os: macos-14
OLDEST_DEPENDENCIES: 'h5py==3.7.0 "numpy<2"'
- python-version: '3.14'
OLDEST_DEPENDENCIES: 'h5py==3.15.1 numpy==2.4.1'
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- uses: actions/download-artifact@v8
with:
pattern: hdf5plugin-*.whl
path: dist
merge-multiple: true
skip-decompress: true
- name: Install hdf5plugin
# First select the right wheel from dist/ with pip download, then install it
run: |
pip download --no-index --no-cache --no-deps --find-links=./dist --only-binary :all: hdf5plugin
pip install "$(ls ./hdf5plugin-*.whl)[test]"
pip uninstall -y blosc2_grok # https://github.com/silx-kit/hdf5plugin/issues/377
- name: Run test with latest h5py
run: python test/test.py
- name: Run test with oldest h5py
run: |
pip install ${{ matrix.OLDEST_DEPENDENCIES }}
python test/test.py
pypi-publish:
needs: [build_wheels, build_sdist, build_doc, test_wheels]
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v8
with:
pattern: hdf5plugin-*.{whl,tar.gz}
path: dist
merge-multiple: true
skip-decompress: true
- uses: pypa/gh-action-pypi-publish@release/v1