Update pre-commit config; remove black target-version as it should au… #26
This file contains 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: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python: [3.8, 3.11] # TODO pypy ? | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- run: pip install -U pre-commit | |
- run: pre-commit run --all | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [x86_64, i686, aarch64] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist | |
manylinux: 2014 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
build-windows: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- arch: x86_64 | |
python: x64 | |
- arch: i686 | |
python: x86 # This works around PyO3 requiring 32-bit Python even though it's not used | |
- arch: aarch64 | |
python: x64 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
architecture: ${{ matrix.target.python }} | |
- uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target.arch }} | |
args: --release --out dist | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
build-macos: | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [x86_64, aarch64] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
build-sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: PyO3/maturin-action@v1 | |
with: | |
command: sdist | |
args: --out dist | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
release: | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/')" | |
needs: [lint, build-linux, build-windows, build-macos, build-sdist] | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
- uses: PyO3/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
with: | |
command: upload | |
args: --skip-existing * |