1- name : Build wheels and deploy to PyPI
1+ name : release- deploy
22
33on :
44 release :
55 types : [ published ]
66
77jobs :
8- build_wheels :
9- name : Build wheels for ${{ matrix.os }}
8+ build-sdist :
9+ name : Build source distribution
10+ runs-on : ubuntu-latest
11+ timeout-minutes : 10
12+ steps :
13+ - uses : actions/checkout@v2
14+ with :
15+ submodules : true
16+
17+ - uses : actions/setup-python@v2
18+ name : Install Python
19+ with :
20+ python-version : ' 3.10'
21+
22+ - name : Build sdist
23+ run : |
24+ python -m pip install .
25+ python setup.py sdist
26+
27+ - name : Store artifacts
28+ uses : actions/upload-artifact@v2
29+ with :
30+ name : wheels
31+ path : ./dist
32+
33+ build-wheels :
34+ name : Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}
1035 runs-on : ${{ matrix.os }}
11- env :
12- CIBW_BUILD : " cp3*-*"
13- CIBW_SKIP : " cp35-*"
1436 strategy :
37+ fail-fast : false
1538 matrix :
16- os : [ubuntu-latest, windows-latest, macos-latest]
17- python-version : [3.9]
39+ include :
40+ # Windows 32 bit
41+ - os : windows-latest
42+ python : 37
43+ platform_id : win32
44+ - os : windows-latest
45+ python : 38
46+ platform_id : win32
47+ - os : windows-latest
48+ python : 39
49+ platform_id : win32
50+ - os : windows-latest
51+ python : 310
52+ platform_id : win32
53+
54+ # Windows 64 bit
55+ - os : windows-latest
56+ python : 37
57+ platform_id : win_amd64
58+ - os : windows-latest
59+ python : 38
60+ platform_id : win_amd64
61+ - os : windows-latest
62+ python : 39
63+ platform_id : win_amd64
64+ - os : windows-latest
65+ python : 310
66+ platform_id : win_amd64
67+
68+ # Linux 64 bit manylinux2010
69+ - os : ubuntu-latest
70+ python : 37
71+ platform_id : manylinux_x86_64
72+ manylinux_image : manylinux2010
73+ - os : ubuntu-latest
74+ python : 38
75+ platform_id : manylinux_x86_64
76+ manylinux_image : manylinux2010
77+ - os : ubuntu-latest
78+ python : 39
79+ platform_id : manylinux_x86_64
80+ manylinux_image : manylinux2010
81+
82+ # Linux 64 bit manylinux2014
83+ - os : ubuntu-latest
84+ python : 37
85+ platform_id : manylinux_x86_64
86+ manylinux_image : manylinux2014
87+ - os : ubuntu-latest
88+ python : 38
89+ platform_id : manylinux_x86_64
90+ manylinux_image : manylinux2014
91+ - os : ubuntu-latest
92+ python : 39
93+ platform_id : manylinux_x86_64
94+ manylinux_image : manylinux2014
95+ - os : ubuntu-latest
96+ python : 310
97+ platform_id : manylinux_x86_64
98+ manylinux_image : manylinux2014
99+
100+ # MacOS x86_64
101+ - os : macos-latest
102+ python : 37
103+ platform_id : macosx_x86_64
104+ - os : macos-latest
105+ python : 38
106+ platform_id : macosx_x86_64
107+ - os : macos-latest
108+ python : 39
109+ platform_id : macosx_x86_64
110+ - os : macos-latest
111+ python : 310
112+ platform_id : macosx_x86_64
113+
114+ # MacOS arm64
115+ - os : macos-latest
116+ python : 38
117+ platform_id : macosx_arm64
118+ - os : macos-latest
119+ python : 39
120+ platform_id : macosx_arm64
121+ - os : macos-latest
122+ python : 310
123+ platform_id : macosx_arm64
18124
19125 steps :
20126 - uses : actions/checkout@v2
@@ -24,35 +130,90 @@ jobs:
24130 - uses : actions/setup-python@v2
25131 name : Install Python
26132 with :
27- python-version : ${{ matrix.python-version }}
133+ python-version : ' 3.9 '
28134
29135 - name : Install cibuildwheel
30-
31136 run : |
32- python -m pip install cibuildwheel==1.10.0
33-
34- - name : Build sdist
35- run : |
36- python setup.py sdist
137+ python -m pip install -U pip
138+ python -m pip install cibuildwheel==2.3.1
37139
38140 - name : Build wheels
141+ env :
142+ CIBW_BUILD : cp${{ matrix.python }}-${{ matrix.platform_id }}
143+ CIBW_ARCHS : all
144+ CIBW_MANYLINUX_X86_64_IMAGE : ${{ matrix.manylinux_image }}
145+ CIBW_MANYLINUX_I686_IMAGE : ${{ matrix.manylinux_image }}
146+ CIBW_BUILD_VERBOSITY : 1
39147 run : |
40148 python --version
41149 python -m cibuildwheel --output-dir dist
42150
43- - uses : actions/upload-artifact@v2
151+ - name : Store artifacts
152+ uses : actions/upload-artifact@v2
44153 with :
45154 name : wheels
46155 path : ./dist
47156
157+ test-package :
158+ name : Test built package
159+ needs : [ build-wheels, build-sdist ]
160+ runs-on : ubuntu-latest
161+ timeout-minutes : 30
162+ strategy :
163+ fail-fast : false
164+ matrix :
165+ python-version : ['3.7', '3.8', '3.9', '3.10']
166+
167+ steps :
168+ - uses : actions/checkout@v2
169+ with :
170+ submodules : true
171+
172+ - name : Set up Python ${{ matrix.python-version }}
173+ uses : actions/setup-python@v2
174+ with :
175+ python-version : ${{ matrix.python-version }}
176+
177+ - name : Download the wheels
178+ uses : actions/download-artifact@v2
179+ with :
180+ name : wheels
181+ path : dist/
182+
183+ - name : Install from package wheels and test
184+ run : |
185+ python -m venv env/test
186+ source env/test/bin/activate
187+ python -m pip install -U pip
188+ python -m pip install pytest pydicom pylibjpeg
189+ python -m pip uninstall -y pylibjpeg-libjpeg
190+ python -m pip uninstall -y pylibjpeg-openjpeg
191+ python -m pip install git+https://github.com/pydicom/pylibjpeg-data
192+ python -m pip install -U --find-links dist/ pylibjpeg-libjpeg
193+ python -c "import pytest; pytest.main(['--pyargs', 'libjpeg.tests'])"
194+ deactivate
195+
196+ - name : Install from package tarball and test
197+ run : |
198+ python -m venv env/testsrc
199+ source env/testsrc/bin/activate
200+ python -m pip install -U pip
201+ python -m pip install pytest pydicom pylibjpeg
202+ python -m pip uninstall -y pylibjpeg-libjpeg
203+ python -m pip uninstall -y pylibjpeg-openjpeg
204+ python -m pip install git+https://github.com/pydicom/pylibjpeg-data
205+ python -m pip install -U dist/pylibjpeg-libjpeg-*.tar.gz
206+ python -c "import pytest; pytest.main(['--pyargs', 'libjpeg.tests'])"
207+ deactivate
208+
48209 # The pypi upload fails with non-linux containers, so grab the uploaded
49210 # artifacts and run using those
50211 # See: https://github.com/pypa/gh-action-pypi-publish/discussions/15
51212 deploy :
52213 name : Upload wheels to PyPI
53- needs :
54- - build_wheels
214+ needs : [ test-package ]
55215 runs-on : ubuntu-latest
216+ timeout-minutes : 10
56217
57218 steps :
58219 - name : Download the wheels
0 commit comments