|
1 | | -# CI workflow to build Python wheels for Linux and Windows across multiple Python versions. |
2 | | -# Triggered on tag pushes for releases or manually via workflow_dispatch. |
3 | | -# Builds binary wheels and source distribution, then publishes to PyPI on tagged releases. |
4 | | - |
| 1 | +# CI workflow to build Python wheels for Linux, Windows, and macOS. |
5 | 2 | name: CI |
6 | 3 |
|
7 | 4 | on: |
8 | 5 | push: |
| 6 | + branches: |
| 7 | + - main |
9 | 8 | tags: |
10 | 9 | - '*' |
11 | 10 | workflow_dispatch: |
|
25 | 24 | - uses: actions/setup-python@v5 |
26 | 25 | with: |
27 | 26 | python-version: ${{ matrix.python-version }} |
28 | | - allow-prereleases: false |
29 | | - - name: Verify Python version |
30 | | - run: python --version |
31 | 27 | - name: Build wheels |
32 | 28 | uses: PyO3/maturin-action@v1 |
33 | 29 | with: |
|
51 | 47 | - uses: actions/setup-python@v5 |
52 | 48 | with: |
53 | 49 | python-version: ${{ matrix.python-version }} |
54 | | - allow-prereleases: false |
55 | 50 | architecture: x64 |
56 | | - - name: Verify Python version |
57 | | - run: python --version |
58 | 51 | - name: Build wheels |
59 | 52 | uses: PyO3/maturin-action@v1 |
60 | 53 | with: |
|
66 | 59 | name: wheels-windows-${{ matrix.target }}-py${{ matrix.python-version }} |
67 | 60 | path: dist |
68 | 61 |
|
| 62 | + macos: |
| 63 | + runs-on: macos-latest |
| 64 | + strategy: |
| 65 | + matrix: |
| 66 | + python-version: ["3.10", "3.11", "3.12", "3.13"] |
| 67 | + target: [x86_64, aarch64] |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@v4 |
| 70 | + - uses: actions/setup-python@v5 |
| 71 | + with: |
| 72 | + python-version: ${{ matrix.python-version }} |
| 73 | + - name: Build wheels |
| 74 | + uses: PyO3/maturin-action@v1 |
| 75 | + with: |
| 76 | + target: ${{ matrix.target }} |
| 77 | + args: --release --out dist -i python${{ matrix.python-version }} |
| 78 | + - name: Upload wheels |
| 79 | + uses: actions/upload-artifact@v4 |
| 80 | + with: |
| 81 | + name: wheels-macos-${{ matrix.target }}-py${{ matrix.python-version }} |
| 82 | + path: dist |
| 83 | + |
69 | 84 | sdist: |
70 | 85 | runs-on: ubuntu-latest |
71 | 86 | steps: |
|
85 | 100 | name: Release |
86 | 101 | runs-on: ubuntu-latest |
87 | 102 | if: ${{ startsWith(github.ref, 'refs/tags/') }} |
88 | | - needs: [linux, windows, sdist] |
| 103 | + needs: [linux, windows, macos, sdist] |
89 | 104 | permissions: |
90 | 105 | id-token: write |
91 | 106 | contents: write |
|
0 commit comments