Run cargo update #713
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: Build and publish wheels | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build_wheels: | |
name: Wheels ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# Numpy provides wheels for x86_64 and aarch64 only, we do the same | |
include: | |
- os: ubuntu-latest | |
name: "Manylinux x86_64" | |
flags: "--zig --target=x86_64-unknown-linux-gnu --compatibility=manylinux2014" | |
- os: ubuntu-latest | |
name: "Manylinux aarch64" | |
flags: "--zig --target=aarch64-unknown-linux-gnu --compatibility=manylinux2014" | |
- os: macos-latest | |
name: "Universal2 macOS" | |
flags: "--target=universal2-apple-darwin" | |
- os: windows-latest | |
name: "Windows x86_64" | |
flags: "" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Install maturin | |
run: | | |
pip install maturin | |
- name: Install zig on Linux | |
if: ${{ runner.os == 'Linux' }} | |
run: | | |
pip install ziglang | |
- name: Set up Rust on Linux | |
if: ${{ runner.os == 'Linux' }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: aarch64-unknown-linux-gnu,x86_64-unknown-linux-gnu | |
- name: Set up Rust on macOS | |
if: ${{ runner.os == 'macos' }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: aarch64-apple-darwin,x86_64-apple-darwin | |
- name: Build wheels | |
run: | | |
maturin build --release -o dist ${{ matrix.flags }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dist/*.whl | |
if-no-files-found: error | |
name: "artifact_${{ matrix.name }}" | |
make_sdist: | |
name: Make SDist | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build SDist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dist/*.tar.gz | |
if-no-files-found: error | |
name: artifact_sdist | |
publish: | |
needs: [ build_wheels, make_sdist ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: artifact_* | |
merge-multiple: true | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |