Python 3.12 wheels, remove Python 3.7 support #80
Workflow file for this run
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: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
release: | |
types: [published] | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.8', '3.12'] | |
steps: | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-python-${{ matrix.python-version }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: 'Pipfile.lock' | |
- name: pip install pipenv | |
run: pip install -U pip pipenv | |
- name: pipenv install | |
run: pipenv install --dev --python ${{ matrix.python-version }} | |
- run: pipenv run maturin develop | |
- run: pipenv run pytest | |
- run: pipenv run maturin sdist -o dist | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' }} | |
- name: Upload wheels | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
linux: | |
runs-on: ubuntu-latest | |
needs: test | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: PyO3/maturin-action@v1 | |
with: | |
manylinux: auto | |
command: build | |
args: --release -o dist -i python${{ matrix.python-version }} | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
windows: | |
runs-on: windows-latest | |
needs: test | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: PyO3/maturin-action@v1 | |
with: | |
command: build | |
args: --release -o dist -i python${{ matrix.python-version }} | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
macos: | |
runs-on: macos-latest | |
needs: test | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: PyO3/maturin-action@v1 | |
with: | |
command: build | |
args: --release -o dist --universal2 -i python${{ matrix.python-version }} | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/')" | |
needs: [ macos, windows, linux ] | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
pip install --upgrade twine | |
twine upload --skip-existing * |