1- name : maturin builds
1+ name : Build Python Wheels
22
33on :
44 push :
5+ tags :
6+ - ' *'
57 pull_request :
68
79jobs :
8- # Inspired on action from cramjam: https://github.com/milesgranger/cramjam
9- build-test :
10- runs-on : ${{ matrix.conf.os }}
11- name : ${{ matrix.conf.os }}-${{ matrix.python-version }}-${{ matrix.conf.target-triple }}-${{ matrix.conf.target }}
10+ linux :
11+ runs-on : ubuntu-latest
1212 strategy :
13- fail-fast : ${{ !( startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/tags/') ) }}
1413 matrix :
15- python-version :
16- - ' 3.9'
17- - ' 3.10'
18- - ' 3.11'
19- - ' 3.12'
20- - ' 3.13'
21- conf :
22- - { os: ubuntu-latest, target: x86_64, target-triple: x86_64-unknown-linux-gnu, manylinux: auto }
23- # - { os: ubuntu-latest, target: x86_64, target-triple: x86_64-unknown-linux-musl, manylinux: musllinux_1_1 }
24- # - { os: ubuntu-latest, target: i686, target-triple: i686-unknown-linux-gnu, manylinux: auto }
25- # - { os: ubuntu-latest, target: i686, target-triple: i686-unknown-linux-musl, manylinux: musllinux_1_1 }
26- # - { os: ubuntu-latest, target: aarch64, target-triple: aarch64-unknown-linux-gnu, manylinux: auto }
27- # - { os: ubuntu-latest, target: aarch64, target-triple: aarch64-unknown-linux-musl, manylinux: musllinux_1_1 }
28- # - { os: ubuntu-latest, target: armv7, target-triple: armv7-unknown-linux-gnueabihf, manylinux: auto }
29- # - { os: ubuntu-latest, target: armv7, target-triple: armv7-unknown-linux-musleabihf, manylinux: musllinux_1_1 }
30- # - { os: ubuntu-latest, target: s390x, target-triple: s390x-unknown-linux-gnu, manylinux: auto }
31- # - { os: ubuntu-latest, target: s390x, target-triple: s390x-unknown-linux-musl, manylinux: musllinux_1_1 } # no target musl for s390x
32- # - { os: ubuntu-latest, target: ppc64le, target-triple: powerpc64le-unknown-linux-gnu, manylinux: auto }
33- # - { os: ubuntu-latest, target: ppc64le, target-triple: powerpc64le-unknown-linux-musleabihf, manylinux: musllinux_1_1 } # no target musl for ppc64le
34-
35- - { os: macos-13, target: x86_64, target-triple: x86_64-apple-darwin }
36- - { os: macos-13, target: aarch64, target-triple: aarch64-apple-darwin }
37- # - { os: macos-13, target: universal2, target-triple: x86_64-apple-darwin }
38-
39- - { os: windows-latest, target: x86_64, target-triple: x86_64-pc-windows-msvc, python-architecture: x64 }
40- - { os: windows-latest, target: i686, target-triple: i686-pc-windows-msvc, python-architecture: x86 }
41-
42- include :
43- # Windows x86_64 pypy
44- - conf : { os: windows-latest, target: x86_64, target-triple: x86_64-pc-windows-msvc }
45- python-version : pypy3.10
46-
47- # Linux x86_64 pypy
48- - conf : { os: ubuntu-latest, target: x86_64, target-triple: x86_64-unknown-linux-gnu, manylinux: auto }
49- python-version : pypy3.10
50-
51- # Linux arm pypy
52- - conf : { os: ubuntu-latest, target: aarch64, target-triple: aarch64-unknown-linux-gnu, manylinux: auto }
53- python-version : pypy3.10
54-
55- # OSX x86_64 pypy
56- - conf : { os: macos-13, target: x86_64, target-triple: x86_64-apple-darwin }
57- python-version : pypy3.10
58-
59- # OSX universal2 pypy
60- - conf : { os: macos-13, target: universal2, target-triple: x86_64-apple-darwin }
61- python-version : pypy3.10
62-
63- # OSX arm pypy
64- - conf : { os: macos-13, target: aarch64, target-triple: aarch64-apple-darwin }
65- python-version : pypy3.10
66-
14+ target : [x86_64-unknown-linux-gnu, i686-unknown-linux-gnu]
6715 steps :
6816 - uses : actions/checkout@v4
69- - uses : actions/setup-python@v5
70- with :
71- python-version : ${{ matrix.python-version }}
72- architecture : ${{ matrix.conf.python-architecture }}
73- allow-prereleases : true
74-
75- - name : Install Rust toolchain
76- uses : dtolnay/rust-toolchain@stable
17+ - uses : actions/setup-python@v4
7718 with :
78- target : ${{ matrix.conf.target-triple }}
79-
80- - name : Set MSVC developer prompt
81- if : runner.os == 'Windows'
82- uses : ilammy/msvc-dev-cmd@v1
83-
84- - name : Build wheel (OSX - Linux)
85- if : runner.os != 'Windows'
19+ python-version : " 3.9"
20+ architecture : x64
21+ - uses : dtolnay/rust-toolchain@stable
22+ - name : Install system dependencies
23+ run : |
24+ sudo apt-get update
25+ sudo apt-get install -y libclang-dev liblzma-dev
26+ awk '/dependencies = \[/,/\]/' pyproject.toml | \
27+ grep -v "dependencies" | \
28+ grep -v "\[" | grep -v "\]" | tr -d '", ' | \
29+ xargs pip install
30+ - name : Build wheels
8631 uses : PyO3/maturin-action@v1
8732 with :
88- target : ${{ matrix.conf.target }}
89- manylinux : ${{ matrix.conf.manylinux }}
90- args : -i ${{ matrix.python-version }} --release --out dist
91-
92- - name : Build wheel (Windows)
93- if : runner.os == 'Windows'
94- run : |
95- python -m pip install maturin delvewheel
96- maturin build -i python --release --out wheels --target ${{ matrix.conf.target-triple }}
97- $file = Get-ChildItem -Path "wheels" | Select-Object -First 1
98- delvewheel repair -v "wheels\$($file.Name)" -w "dist"
99-
100- # - name: Upload wheels
101- # uses: actions/upload-artifact@v4
102- # if: ${{ ( startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/tags/') ) }}
103- # with:
104- # name: ${{ matrix.conf.os }}-${{ matrix.python-version }}-${{ matrix.conf.target-triple }}-${{ matrix.conf.target }}
105- # path: dist
106-
107- # sdist:
108- # runs-on: ubuntu-latest
109- # steps:
110- # - uses: actions/checkout@v4
111- # - name: Build sdist
112- # uses: PyO3/maturin-action@v1
113- # with:
114- # command: sdist
115- # args: --out dist
116- # - name: Upload sdist
117- # uses: actions/upload-artifact@v4
118- # with:
119- # name: wheels-sdist
120- # path: dist
121-
122- # release:
123- # name: Release
124- # runs-on: ubuntu-latest
125- # if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
126- # needs: [linux, musllinux, windows, macos, sdist]
127- # permissions:
128- # # Use to sign the release artifacts
129- # id-token: write
130- # # Used to upload release artifacts
131- # contents: write
132- # # Used to generate artifact attestation
133- # attestations: write
134- # steps:
135- # - uses: actions/download-artifact@v4
136- # - name: Generate artifact attestation
137- # uses: actions/attest-build-provenance@v1
138- # with:
139- # subject-path: 'wheels-*/*'
140- # - name: Publish to PyPI
141- # if: "startsWith(github.ref, 'refs/tags/')"
142- # uses: PyO3/maturin-action@v1
143- # env:
144- # MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
145- # with:
146- # command: upload
147- # args: --non-interactive --skip-existing wheels-*/*
33+ target : ${{ matrix.target }}
34+ manylinux : auto
35+ args : --release --out dist
0 commit comments