Skip to content

Tweaks to actions

Tweaks to actions #39

Workflow file for this run

name: Build Wheels
on:
push:
branches:
- main # Adjust to match your primary branch name
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Check out code
uses: actions/checkout@v4
# Install Rust and Cargo
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install maturin
run: pip install maturin
- name: Build wheel
run: maturin build --release
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.python-version }}
path: target/wheels/*.whl
publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all wheels
uses: actions/download-artifact@v4
with:
path: wheels
pattern: wheels-*
merge-multiple: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install twine
run: pip install twine
- name: Publish to PyPI
run: twine upload wheels/*.whl --username "__token__" --password ${{ secrets.PYPI_API_TOKEN }}
- name: List directory contents (for debugging)
if: failure()
run: |
ls -R wheels