Skip to content

bump to 0.20

bump to 0.20 #67

Workflow file for this run

name: pypi
on:
workflow_dispatch:
push:
tags:
- "*"
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [main, alt]
include:
- os: ubuntu-latest
platform: linux
- os: windows-latest
ls: dir
- os: macos-latest
arch: alt
alt_arch_name: arm64
- os: ubuntu-latest
platform: linux
alt_arch_name: aarch64
exclude:
- os: windows-latest
arch: alt
- os: macos-latest
arch: alt
- os: ubuntu-latest
arch: alt
steps:
- uses: actions/checkout@v3
- name: set up rust
if: matrix.os != 'ubuntu-latest'
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup target add aarch64-apple-darwin
if: matrix.os == 'macos-latest'
- run: rustup toolchain install stable-i686-pc-windows-msvc
if: matrix.os == 'windows-latest'
- run: rustup target add i686-pc-windows-msvc
if: matrix.os == 'windows-latest'
- name: Set up QEMU
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*"
CIBW_BEFORE_BUILD: >
pip install setuptools-rust cython &&
rustup default nightly &&
rustup show
# rust doesn't seem to be available for musl linux on i686
CIBW_SKIP: "*-musllinux_i686"
# we build for "alt_arch_name" if it exists, else 'auto
CIBW_ARCHS: ${{ matrix.alt_arch_name || 'auto' }}
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
CIBW_MUSLLINUX_X86_64_IMAGE: "musllinux_1_1"
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"
CIBW_MUSLLINUX_AARCH64_IMAGE: "musllinux_1_1"
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH"'
# Fix the following error: error: cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module -- --crate-type cdylibfailed with code -9
# You need to set a second environment variable CARGO_NET_GIT_FETCH_WITH_CLI="true" for linux environments
# Solutio found here: https://github.com/rust-lang/cargo/issues/10583
CIBW_ENVIRONMENT_LINUX: 'PATH="$HOME/.cargo/bin:$PATH" CARGO_NET_GIT_FETCH_WITH_CLI="true"'
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014"
CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"'
CIBW_BEFORE_BUILD_LINUX: >
pip install cython numpy setuptools wheel setuptools-rust &&
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly --profile=minimal -y &&
rustup show
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: ${{ secrets.pypi_user }}
password: ${{ secrets.pypi_password }}