Skip to content

Commit 15b93fb

Browse files
authored
Merge pull request #39 from SiLab-Bonn/p-cibuildwheel
Update packaging
2 parents 7be9883 + 8d4ef09 commit 15b93fb

1 file changed

Lines changed: 58 additions & 24 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 58 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,80 @@ name: Build wheels
33
on: [push]
44

55
jobs:
6-
build:
6+
build_wheels:
77
name: Build wheels
8-
runs-on: ubuntu-latest
8+
runs-on: ${{ matrix.runs-on }}
9+
strategy:
10+
matrix:
11+
include:
12+
- os: linux-intel
13+
runs-on: ubuntu-latest
14+
- os: linux-arm
15+
runs-on: ubuntu-24.04-arm
16+
# - os: windows-intel
17+
# runs-on: windows-latest
18+
# - os: windows-arm
19+
# runs-on: windows-11-arm
20+
# - os: macos-intel
21+
# # macos-15-intel is the last x86_64 runner
22+
# runs-on: macos-15-intel
23+
- os: macos-arm
24+
# macos-14+ (including latest) are ARM64 runners
25+
runs-on: macos-latest
26+
927
steps:
1028
- uses: actions/checkout@v6
11-
- name: Setup Python
12-
uses: actions/setup-python@v6
13-
with:
14-
python-version: 3.13
15-
- name: Install build
16-
run: |
17-
python -m pip install --upgrade pip
18-
pip install build
1929

20-
- name: Build
21-
run:
22-
python3 -m build
30+
- name: Build wheels
31+
uses: pypa/cibuildwheel@v3.4.1
32+
env:
33+
CIBW_SKIP: "cp314* *-musllinux_*"
34+
CIBW_PLATFORM: ${{ matrix.platform || 'auto' }}
35+
CIBW_ARCHS: ${{ matrix.archs || 'auto' }}
2336

24-
- uses: actions/upload-artifact@v7
37+
- name: Upload wheel artifact
38+
uses: actions/upload-artifact@v7
2539
with:
26-
name: package-dist
27-
path: dist
40+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
41+
path: ./wheelhouse/*.whl
42+
43+
build_sdist:
44+
name: Build source distribution
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v6
48+
with:
49+
persist-credentials: false
50+
51+
- name: Build sdist
52+
run: pipx run build --sdist
53+
54+
- name: Upload sdist artifact
55+
uses: actions/upload-artifact@v7
56+
with:
57+
name: cibw-sdist
58+
path: dist/*.tar.gz
2859

2960
upload:
3061
name: Upload wheels and sdist
3162
runs-on: ubuntu-latest
3263

3364
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
34-
needs: [build]
65+
needs: [build_wheels, build_sdist]
3566
environment:
3667
name: pypi
3768
url: https://pypi.org/p/pylandau
3869
permissions:
3970
id-token: write
4071

4172
steps:
42-
- uses: actions/download-artifact@v8
43-
with:
44-
name: package-dist
45-
path: dist
46-
- uses: pypa/gh-action-pypi-publish@release/v1
47-
with:
48-
verbose: true
73+
- uses: actions/download-artifact@v8
74+
with:
75+
# unpacks all CIBW artifacts into dist/
76+
pattern: cibw-*
77+
path: dist
78+
merge-multiple: true
79+
80+
- uses: pypa/gh-action-pypi-publish@release/v1
81+
with:
82+
verbose: true

0 commit comments

Comments
 (0)