Skip to content

Update pyo3

Update pyo3 #113

Workflow file for this run

name: Release
# This should almost always run, but upload binaries only on tag.
on:
pull_request:
branches: [ master ]
workflow_dispatch:
push:
branches: [ master ]
tags:
- '*.*.*'
# Cancel previous runs on the same PR.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release_manylinux:
name: Release manylinux
runs-on: ubuntu-latest
strategy:
matrix:
python-path: ['cp38-cp38', 'cp39-cp39', 'cp310-cp310', 'cp311-cp311', 'cp312-cp312']
container: quay.io/pypa/manylinux2014_x86_64:latest
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
CC: "gcc"
CFLAGS: "-O2 -fno-plt"
LDFLAGS: "-O2 -flto -Wl,--as-needed"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rust-src
- run: yum install -y libffi libffi-devel openssl openssl-devel
- run: /opt/python/${{ matrix.python-path }}/bin/python -m venv .venv
- run: .venv/bin/pip install -U pip wheel
- run: .venv/bin/pip install -U twine maturin
- run: .venv/bin/pip install -r requirements.txt
- run: .venv/bin/maturin build --features=unstable-simd --release --strip --manylinux 2014 -i /opt/python/${{ matrix.python-path }}/bin/python --target x86_64-unknown-linux-gnu
- run: .venv/bin/pip install ormsgpack --no-index -f target/wheels
- run: .venv/bin/pytest
- if: startsWith(github.ref, 'refs/tags')
run: .venv/bin/twine upload --non-interactive --skip-existing target/wheels/*
release_windows:
name: Release windows
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rust-src
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install --user -U pip wheel twine maturin
- run: pip install -r requirements.txt
- run: maturin build --release --strip -i $pythonLocation"python.exe"
- run: pip install ormsgpack --no-index -f target/wheels
- run: pytest
- if: startsWith(github.ref, 'refs/tags')
run: twine upload --non-interactive --skip-existing target\wheels\*
release_macos_x64:
name: Release macOS (x86_64)
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: macos-latest
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rust-src
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install -U pip wheel twine maturin
- run: pip install -r requirements.txt
- env:
CC: "clang"
CFLAGS: "-O2 -fno-plt -flto=thin"
LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang -C target-feature=+sse4.2"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
run: maturin build --release --strip --manylinux off -i $pythonLocation/python --features=unstable-simd -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-apple-darwin
- run: pip install ormsgpack --no-index -f target/wheels
- run: pytest
- if: startsWith(github.ref, 'refs/tags')
run: twine upload --non-interactive --skip-existing target/wheels/*
release_macos_universal:
name: Release macOS (universal)
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: macos-latest
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
target: aarch64-apple-darwin
components: rust-src
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install -U pip wheel twine maturin
- env:
CC: "clang"
CFLAGS: "-O2 -fno-plt -flto=thin"
LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
run: PATH=$HOME/.cargo/bin:$PATH PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") maturin build --release --strip --features=unstable-simd --target universal2-apple-darwin
- if: startsWith(github.ref, 'refs/tags')
run: twine upload --non-interactive --skip-existing target/wheels/*
release_sdist:
name: Release sdist
runs-on: ubuntu-latest
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rust-src
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- run: python -m pip install -U pip wheel twine maturin
- run: pip install -r requirements.txt
- run: maturin sdist
- if: startsWith(github.ref, 'refs/tags')
run: twine upload --non-interactive --skip-existing target/wheels/*