Merge remote-tracking branch 'origin/main'

This commit is contained in:
Bill
2026-02-09 16:25:35 -07:00

View File

@@ -9,7 +9,7 @@ on:
jobs: jobs:
build_and_publish: build_and_publish:
name: Build and Publish All Wheels name: Build and Publish All Wheels
runs-on: ubuntu-latest runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
@@ -18,10 +18,17 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
# Only setup python for non-linux, or let maturin handle linux via docker
- name: Set up Python - name: Set up Python
if: runner.os != 'Linux'
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: '3.12' python-version: '3.12'
# Note: On Windows/Mac, to build for multiple python versions,
# you usually need multiple setup-python steps or a matrix of python versions.
# But for now, let's at least get the artifacts downloading correctly.
# Ideally, you remove this and let maturin find python, but GitHub runners
# might only have one default.
- name: Install Rust - name: Install Rust
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
@@ -32,6 +39,7 @@ jobs:
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@v1
with: with:
target: ${{ matrix.target }} target: ${{ matrix.target }}
manylinux: auto # This triggers the Docker container on Linux for multi-python builds
command: build command: build
args: --release --out dist --find-interpreter args: --release --out dist --find-interpreter
@@ -50,35 +58,19 @@ jobs:
- name: Install maturin - name: Install maturin
run: pip install maturin run: pip install maturin
# FIX: Use merge-multiple to flatten everything into 'dist' automatically
- name: Download ALL wheels - name: Download ALL wheels
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
path: dist path: dist
pattern: wheel-*
merge-multiple: true
- name: Flatten and upload - name: List Files (Debug)
run: ls -la dist
- name: Upload to PyPI
env: env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} # ← CORRECT TOKEN VAR MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: | run: |
mkdir -p dist/flattened maturin upload --skip-existing --non-interactive dist/*
rm -rf dist/flattened/*
# Copy EVERY wheel
find dist -name "*.whl" | while read wheel; do
cp "$wheel" dist/flattened/
done
echo "=== TOTAL WHEELS ==="
ls -la dist/flattened/*.whl | wc -l
cd dist/flattened
echo "=== UPLOADING $(ls *.whl | wc -l) WHEELS ==="
ls -la *.whl | head -5
# TWINE fallback (double protection)
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=${{ secrets.PYPI_API_TOKEN }}
maturin upload --skip-existing --non-interactive *.whl