Publish wheels for Python 3.12+ using abi3 #48
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| runs-on: [ ubuntu-latest, windows-latest, macos-latest ] | |
| python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14' ] | |
| runs-on: ${{ matrix.runs-on }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build package | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| manylinux: auto | |
| args: -i ${{ matrix.python-version }} --release | |
| - name: Test package | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-dev.txt zstandard | |
| python -c "import zstandard;zstandard.ZstdDecompressor().copy_stream(open('tests/data/system.dic.zst','rb'),open('tests/data/system.dic','wb'))" | |
| pip install vibrato --no-index --find-links target/wheels --force-reinstall | |
| mypy --strict tests | |
| pytest | |
| python -m doctest README.md | |
| python -m doctest docs/source/examples.rst | |
| pack-sdist: | |
| needs: [ test ] | |
| if: "startsWith(github.ref, 'refs/tags/')" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build package | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| command: sdist | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: target/wheels | |
| pack-linux: | |
| needs: [ test ] | |
| if: "startsWith(github.ref, 'refs/tags/')" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| target: [ x86_64, i686 ] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.8' | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build package | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| manylinux: auto | |
| args: -i 3.8 --release | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-linux-${{ matrix.target }} | |
| path: target/wheels | |
| pack-windows: | |
| needs: [ test ] | |
| if: "startsWith(github.ref, 'refs/tags/')" | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| target: [ x64, x86 ] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.8' | |
| architecture: ${{ matrix.target }} | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build package | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| manylinux: auto | |
| args: -i 3.8 --release | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-windows-${{ matrix.target }} | |
| path: target/wheels | |
| pack-macos: | |
| needs: [ test ] | |
| if: "startsWith(github.ref, 'refs/tags/')" | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.8' | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build package | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| manylinux: auto | |
| args: -i 3.8 --release --universal2 | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-macos-universal2 | |
| path: target/wheels | |
| release: | |
| name: Release | |
| if: "startsWith(github.ref, 'refs/tags/')" | |
| needs: [ pack-sdist, pack-linux, pack-windows, pack-macos ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sdist | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheels-* | |
| merge-multiple: true | |
| - name: Publish to PyPI | |
| uses: messense/maturin-action@v1 | |
| env: | |
| MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
| with: | |
| command: upload | |
| args: --skip-existing * |