|
| 1 | +# This workflow will upload a Python Package to PyPI when a release is created |
| 2 | +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries |
| 3 | + |
| 4 | +# This workflow uses actions that are not certified by GitHub. |
| 5 | +# They are provided by a third-party and are governed by |
| 6 | +# separate terms of service, privacy policy, and support |
| 7 | +# documentation. |
| 8 | + |
| 9 | +name: Build and Publish Wheels |
| 10 | + |
| 11 | +on: |
| 12 | + push: |
| 13 | + tags: |
| 14 | + - 'v*.*.*' # Triggers when a version tag is pushed, e.g., v1.2.3 |
| 15 | + |
| 16 | +jobs: |
| 17 | + build-and-publish-manylinux: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v3 |
| 25 | + |
| 26 | + - name: Install Rust Toolchain |
| 27 | + uses: actions-rs/toolchain@v1 |
| 28 | + with: |
| 29 | + toolchain: stable |
| 30 | + override: true |
| 31 | + |
| 32 | + - name: Set Up Python ${{ matrix.python-version }} |
| 33 | + uses: actions/setup-python@v4 |
| 34 | + with: |
| 35 | + python-version: ${{ matrix.python-version }} |
| 36 | + |
| 37 | + - name: Build and Publish Wheel |
| 38 | + uses: pyo3/maturin-action@v1 |
| 39 | + with: |
| 40 | + command: publish |
| 41 | + token: ${{ secrets.PYPI_TOKEN }} |
| 42 | + manylinux: auto |
| 43 | + python-version: ${{ matrix.python-version }} |
| 44 | + extra-args: --skip-existing |
| 45 | + |
| 46 | + build-and-publish-macos: |
| 47 | + runs-on: macos-latest |
| 48 | + strategy: |
| 49 | + fail-fast: false |
| 50 | + matrix: |
| 51 | + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v3 |
| 54 | + |
| 55 | + - name: Set Up Python ${{ matrix.python-version }} |
| 56 | + uses: actions/setup-python@v4 |
| 57 | + with: |
| 58 | + python-version: ${{ matrix.python-version }} |
| 59 | + |
| 60 | + - name: Build and Publish Wheel |
| 61 | + uses: pyo3/maturin-action@v1 |
| 62 | + with: |
| 63 | + command: publish |
| 64 | + token: ${{ secrets.PYPI_TOKEN }} |
| 65 | + python-version: ${{ matrix.python-version }} |
| 66 | + extra-args: "--universal2 --skip-existing" |
| 67 | + |
| 68 | + build-and-publish-windows: |
| 69 | + runs-on: windows-latest |
| 70 | + strategy: |
| 71 | + fail-fast: false |
| 72 | + matrix: |
| 73 | + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
| 74 | + steps: |
| 75 | + - uses: actions/checkout@v3 |
| 76 | + |
| 77 | + - name: Install Rust Toolchain |
| 78 | + uses: actions-rs/toolchain@v1 |
| 79 | + with: |
| 80 | + toolchain: stable |
| 81 | + override: true |
| 82 | + |
| 83 | + - name: Set Up Python ${{ matrix.python-version }} |
| 84 | + uses: actions/setup-python@v4 |
| 85 | + with: |
| 86 | + python-version: ${{ matrix.python-version }} |
| 87 | + |
| 88 | + - name: Build and Publish Wheel |
| 89 | + uses: pyo3/maturin-action@v1 |
| 90 | + with: |
| 91 | + command: publish |
| 92 | + token: ${{ secrets.PYPI_TOKEN }} |
| 93 | + python-version: ${{ matrix.python-version }} |
| 94 | + extra-args: --skip-existing |
0 commit comments