Skip to content

Commit 43747b9

Browse files
Transurgeonclaude
andcommitted
Align CI workflow with CVXPY build pattern
- Matrix of OS x Python version (3.11, 3.12, 3.13, 3.14) - Per-version CIBW_BUILD with PYTHON_SUBVERSION - QEMU for Linux aarch64 cross-compilation - Skip win32, i686, musllinux - macOS x86_64 + universal2 architectures - Twine check on built wheels - Concurrency control for PRs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b880255 commit 43747b9

File tree

1 file changed

+46
-13
lines changed

1 file changed

+46
-13
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,76 @@ on:
99
pull_request:
1010
workflow_dispatch:
1111

12+
# Only cancels-in-progress on PRs (head_ref only defined in PR, fallback run_id always unique)
13+
concurrency:
14+
group: ${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
1217
jobs:
1318
build_wheels:
14-
name: Build wheels on ${{ matrix.os }}
1519
runs-on: ${{ matrix.os }}
1620
strategy:
21+
fail-fast: false
1722
matrix:
18-
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
23+
os: [ ubuntu-22.04, macos-14, windows-2022 ]
24+
python-version: [ "3.11", "3.12", "3.13", "3.14" ]
25+
26+
env:
27+
PYTHON_VERSION: ${{ matrix.python-version }}
28+
1929
steps:
20-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v5
31+
with:
32+
submodules: recursive
33+
34+
- uses: actions/setup-python@v6
2135
with:
22-
submodules: true
36+
python-version: ${{ matrix.python-version }}
37+
allow-prereleases: true
38+
39+
- name: Set Python subversion
40+
shell: bash
41+
run: |
42+
echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
43+
44+
- name: Set up QEMU
45+
if: runner.os == 'Linux'
46+
uses: docker/setup-qemu-action@v3
47+
with:
48+
platforms: all
2349

2450
- name: Build wheels
2551
uses: pypa/cibuildwheel@v2.22.0
2652
env:
27-
CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-*"
28-
CIBW_ARCHS_MACOS: "x86_64 arm64"
53+
CIBW_BUILD: "cp3${{ env.PYTHON_SUBVERSION }}-*"
54+
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
55+
CIBW_ARCHS_MACOS: "x86_64 universal2"
56+
CIBW_ARCHS_LINUX: "auto aarch64"
57+
58+
- name: Check wheels
59+
shell: bash
60+
run: |
61+
pip install --upgrade twine
62+
twine check wheelhouse/*
2963
3064
- uses: actions/upload-artifact@v4
3165
with:
32-
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
66+
name: wheels-${{ matrix.os }}-${{ matrix.python-version }}
3367
path: ./wheelhouse/*.whl
3468

3569
build_sdist:
36-
name: Build source distribution
3770
runs-on: ubuntu-latest
3871
steps:
39-
- uses: actions/checkout@v4
72+
- uses: actions/checkout@v5
4073
with:
41-
submodules: true
74+
submodules: recursive
4275

4376
- name: Build sdist
4477
run: pipx run build --sdist
4578

4679
- uses: actions/upload-artifact@v4
4780
with:
48-
name: cibw-sdist
81+
name: sdist
4982
path: ./dist/*.tar.gz
5083

5184
upload_testpypi:
@@ -58,7 +91,7 @@ jobs:
5891
steps:
5992
- uses: actions/download-artifact@v4
6093
with:
61-
pattern: cibw-*
94+
pattern: "{wheels-*,sdist}"
6295
path: dist
6396
merge-multiple: true
6497

@@ -77,7 +110,7 @@ jobs:
77110
steps:
78111
- uses: actions/download-artifact@v4
79112
with:
80-
pattern: cibw-*
113+
pattern: "{wheels-*,sdist}"
81114
path: dist
82115
merge-multiple: true
83116

0 commit comments

Comments
 (0)