Skip to content

Commit b9b82a7

Browse files
committed
update ci
1 parent b139b6a commit b9b82a7

File tree

2 files changed

+96
-63
lines changed

2 files changed

+96
-63
lines changed

.github/workflows/releasebuild.yml

Lines changed: 83 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
name: Full Build
22

3+
34
on:
5+
push:
6+
pull_request:
47
release:
58
types:
69
- published
710

8-
workflow_dispatch:
9-
1011
jobs:
1112
build_sdist:
1213
name: Build source distribution
@@ -16,14 +17,14 @@ jobs:
1617
with:
1718
submodules: 'true'
1819

19-
- uses: actions/setup-python@v4
20+
- uses: actions/setup-python@v5
2021
with:
2122
python-version: "3.12"
2223

2324
- name: Install dependencies
2425
run: |
2526
python -m pip install --upgrade pip
26-
pip install Cython==3.0.7
27+
pip install Cython==3.0.12
2728
2829
# The cythonized files allow installation from the sdist without cython
2930
- name: Generate cython
@@ -33,13 +34,15 @@ jobs:
3334
3435
- name: Build sdist
3536
run: |
36-
pip3 install build; python3 -m build --sdist
37+
git apply ./tools/sdist.patch
38+
pip3 install build
39+
python3 -m build --sdist
3740
# test whether tarball contains all files required for compiling
3841
pip3 install dist/cydifflib-*.tar.gz
39-
pip3 uninstall cydifflib --yes
4042
41-
- uses: actions/upload-artifact@v3
43+
- uses: actions/upload-artifact@v4
4244
with:
45+
name: artifact-sdist
4346
path: dist/*.tar.gz
4447

4548
build_wheels_windows:
@@ -50,98 +53,74 @@ jobs:
5053
fail-fast: false
5154
matrix:
5255
arch: [auto32, auto64, ARM64]
53-
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"]
54-
exclude:
55-
# PyPy only supports x86_64 on Windows
56-
- arch: auto32
57-
python_tag: "pp38-*"
58-
- arch: auto32
59-
python_tag: "pp39-*"
60-
61-
# ARM64 only supported only supported on cpython >= 3.9
62-
- arch: ARM64
63-
python_tag: "pp38-*"
64-
- arch: ARM64
65-
python_tag: "pp39-*"
66-
- arch: ARM64
67-
python_tag: "cp38-*"
6856
env:
69-
CIBW_BUILD: ${{matrix.python_tag}}
7057
CIBW_ARCHS: ${{matrix.arch}}
7158
CIBW_TEST_SKIP: "*-win32"
7259
CIBW_TEST_REQUIRES: pytest
7360
CIBW_TEST_COMMAND: pytest {package}/tests
7461
CIBW_BUILD_VERBOSITY: 3
62+
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
7563

7664
steps:
77-
- uses: actions/download-artifact@v3
65+
- uses: actions/download-artifact@v4
7866
with:
79-
name: artifact
67+
name: artifact-sdist
8068
path: dist
8169

8270
- name: Copy wheel
8371
run: copy dist/*.tar.gz cydifflib.tar.gz
8472

85-
- uses: actions/setup-python@v4
73+
- uses: actions/setup-python@v5
8674

8775
- name: Build wheels
88-
uses: pypa/cibuildwheel@v2.16.5
76+
uses: pypa/cibuildwheel@v2.23.2
8977
with:
9078
package-dir: cydifflib.tar.gz
9179
output-dir: wheelhouse
9280

9381
- name: Upload wheels
94-
uses: actions/upload-artifact@v3
82+
uses: actions/upload-artifact@v4
9583
with:
84+
name: artifact-${{ github.job }}-${{ strategy.job-index }}
9685
path: ./wheelhouse/*.whl
9786

9887
build_wheels_macos:
9988
name: Build wheel on ${{ matrix.os }}/auto/${{matrix.python_tag}}
10089
needs: [build_sdist]
101-
runs-on: macos-latest
90+
runs-on: ${{ matrix.os }}
10291
strategy:
10392
fail-fast: false
10493
matrix:
105-
arch: [x86_64, arm64, universal2]
106-
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"]
107-
exclude:
108-
# PyPy not supported on MacOS Arm
109-
- arch: arm64
110-
python_tag: "pp38-*"
111-
- arch: arm64
112-
python_tag: "pp39-*"
113-
- arch: universal2
114-
python_tag: "pp38-*"
115-
- arch: universal2
116-
python_tag: "pp39-*"
94+
os: [macos-13, macos-14]
11795
env:
118-
CIBW_BUILD: ${{matrix.python_tag}}
119-
CIBW_ARCHS: ${{matrix.arch}}
120-
CIBW_TEST_SKIP: "{*-macosx_{arm64,universal2},pp*-macosx_*}"
96+
CIBW_ARCHS: native
97+
CIBW_TEST_SKIP: "pp*-macosx_*"
12198
CIBW_TEST_REQUIRES: pytest
12299
CIBW_TEST_COMMAND: pytest {package}/tests
123100
CIBW_BUILD_VERBOSITY: 3
101+
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
124102

125103
steps:
126-
- uses: actions/download-artifact@v3
104+
- uses: actions/download-artifact@v4
127105
with:
128-
name: artifact
106+
name: artifact-sdist
129107
path: dist
130108

131-
- uses: actions/setup-python@v4
109+
- uses: actions/setup-python@v5
132110

133111
- name: Copy wheel
134112
run: cp dist/*.tar.gz cydifflib.tar.gz
135113

136114
- name: Build wheels
137-
uses: pypa/cibuildwheel@v2.16.5
115+
uses: pypa/cibuildwheel@v2.23.2
138116
with:
139117
package-dir: cydifflib.tar.gz
140118
output-dir: wheelhouse
141119

142120
- name: Upload wheels
143-
uses: actions/upload-artifact@v3
121+
uses: actions/upload-artifact@v4
144122
with:
123+
name: artifact-${{ github.job }}-${{ strategy.job-index }}
145124
path: ./wheelhouse/*.whl
146125

147126
build_wheels_linux:
@@ -152,48 +131,88 @@ jobs:
152131
fail-fast: false
153132
matrix:
154133
arch: [auto, aarch64, ppc64le, s390x]
155-
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"]
134+
python_tag: ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*", "pp39-*", "pp310-*", "pp311-*"]
156135
exclude:
157136
# PyPy builds not available for these platforms
158137
- arch: ppc64le
159-
python_tag: "pp38-*"
138+
python_tag: "pp39-*"
139+
- arch: ppc64le
140+
python_tag: "pp310-*"
160141
- arch: ppc64le
142+
python_tag: "pp311-*"
143+
- arch: s390x
161144
python_tag: "pp39-*"
162145
- arch: s390x
163-
python_tag: "pp38-*"
146+
python_tag: "pp310-*"
164147
- arch: s390x
165-
python_tag: "pp39-*"
148+
python_tag: "pp311-*"
166149
env:
167150
CIBW_ARCHS_LINUX: ${{matrix.arch}}
168151
CIBW_BUILD: ${{matrix.python_tag}}
169-
CIBW_TEST_SKIP: "{*_{aarch64,ppc64le,s390x},*musllinux_*,pp38-*}"
152+
CIBW_TEST_SKIP: "{*_{aarch64,ppc64le,s390x},*musllinux_*}"
170153
CIBW_TEST_REQUIRES: pytest
171154
CIBW_TEST_COMMAND: pytest {package}/tests
172155
CIBW_BUILD_VERBOSITY: 3
173156

174157
steps:
175-
- uses: actions/download-artifact@v3
158+
- uses: actions/download-artifact@v4
176159
with:
177-
name: artifact
160+
name: artifact-sdist
178161
path: dist
179162

180-
- uses: actions/setup-python@v4
163+
- uses: actions/setup-python@v5
181164

182165
- name: Copy wheel
183166
run: cp dist/*.tar.gz cydifflib.tar.gz
184167

185-
- uses: docker/setup-qemu-action@v2
168+
- uses: docker/setup-qemu-action@v3
186169
name: Set up QEMU
187170

188171
- name: Build wheel
189-
uses: pypa/cibuildwheel@v2.16.5
172+
uses: pypa/cibuildwheel@v2.23.2
173+
with:
174+
package-dir: cydifflib.tar.gz
175+
output-dir: wheelhouse
176+
177+
- name: Upload wheels
178+
uses: actions/upload-artifact@v4
179+
with:
180+
name: artifact-${{ github.job }}-${{ strategy.job-index }}
181+
path: ./wheelhouse/*.whl
182+
183+
build_wheels_pyodide:
184+
name: Build wheels on ubuntu-latest/pyodide
185+
needs: [build_sdist]
186+
runs-on: ubuntu-latest
187+
env:
188+
CIBW_TEST_REQUIRES: pytest hypothesis
189+
CIBW_TEST_COMMAND: pytest {package}/tests
190+
CIBW_PLATFORM: pyodide
191+
CIBW_BUILD_VERBOSITY: 3
192+
193+
steps:
194+
- uses: actions/download-artifact@v4
195+
with:
196+
name: artifact-sdist
197+
path: dist
198+
199+
- uses: actions/setup-python@v5
200+
with:
201+
python-version: "3.12"
202+
203+
- name: Copy wheel
204+
run: cp dist/*.tar.gz cydifflib.tar.gz
205+
206+
- name: Build wheel
207+
uses: pypa/cibuildwheel@v2.23.2
190208
with:
191209
package-dir: cydifflib.tar.gz
192210
output-dir: wheelhouse
193211

194212
- name: Upload wheels
195-
uses: actions/upload-artifact@v3
213+
uses: actions/upload-artifact@v4
196214
with:
215+
name: pyodide-wheel
197216
path: ./wheelhouse/*.whl
198217

199218
deploy-wheels:
@@ -206,9 +225,10 @@ jobs:
206225
id-token: write
207226

208227
steps:
209-
- uses: actions/download-artifact@v3
228+
- uses: actions/download-artifact@v4
210229
with:
211-
name: artifact
212230
path: dist
231+
pattern: artifact-*
232+
merge-multiple: true
213233

214-
- uses: pypa/gh-action-pypi-publish@v1.8.11
234+
- uses: pypa/gh-action-pypi-publish@v1.12.4

tools/sdist.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/pyproject.toml b/pyproject.toml
2+
index 340fee3..87f6afe 100644
3+
--- a/pyproject.toml
4+
+++ b/pyproject.toml
5+
@@ -1,7 +1,6 @@
6+
[build-system]
7+
requires = [
8+
- "scikit-build-core>=0.11",
9+
- "Cython>=3.0.12,<3.1.0"
10+
+ "scikit-build-core>=0.11"
11+
]
12+
build-backend = "scikit_build_core.build"
13+

0 commit comments

Comments
 (0)