pypi #76
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: pypi | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "*" | |
# Cython-3.0.6-cp310-cp310-macosx_10_9_x86_64.whl | |
# Cython-3.0.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | |
# Cython-3.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | |
# Cython-3.0.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl | |
# Cython-3.0.6-cp310-cp310-musllinux_1_1_aarch64.whl | |
# Cython-3.0.6-cp310-cp310-musllinux_1_1_x86_64.whl | |
# Cython-3.0.6-cp310-cp310-win32.whl | |
# Cython-3.0.6-cp310-cp310-win_amd64.whl | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-11, macos-latest] | |
arch: [main, 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/cibuildwheel@v2.16.2 | |
env: | |
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" | |
CIBW_BEFORE_ALL: > | |
rustup default nightly && | |
rustup show | |
# rust doesn't seem to be available for musl linux on i686 | |
# CIBW_SKIP: "*-musllinux_{i686,aarch64}" | |
# we build for "alt_arch_name" if it exists, else 'auto | |
CIBW_ARCHS_LINUX: "x86_64 i686 aarch64 ppc64le s390x" | |
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2" | |
CIBW_ARCHS_WINDOWS: "AMD64 x86 ARM64" | |
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014" | |
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014" | |
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014" | |
CIBW_MANYLINUX_PPC64LE_IMAGE: "manylinux2014" | |
CIBW_MANYLINUX_S390X_IMAGE: "manylinux2014" | |
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "manylinux2014" | |
CIBW_MANYLINUX_PYPY_I686_IMAGE: "manylinux2014" | |
CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: "manylinux2014" | |
CIBW_MUSLLINUX_X86_64_IMAGE: "musllinux_1_1" | |
CIBW_MUSLLINUX_I686_IMAGE: "musllinux_1_1" | |
CIBW_MUSLLINUX_AARCH64_IMAGE: "musllinux_1_1" | |
CIBW_MUSLLINUX_PPC64LE_IMAGE: "musllinux_1_1" | |
CIBW_MUSLLINUX_S390X_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_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"' | |
CIBW_BEFORE_BUILD_LINUX: > | |
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@v3 | |
- name: Build River | |
uses: ./.github/actions/install-env | |
with: | |
python-version: "3.12" | |
- name: Build dist | |
run: poetry build | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@v1.8.10 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |