Wheel Builds #23
Workflow file for this run
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
# modified from https://github.com/Qiskit/rustworkx/blob/main/.github/workflows/wheels.yml | |
name: Wheel Builds | |
# on: | |
# push: | |
# tags: | |
# - '*' | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
# gsea-core: | |
# name: Publish gsea-core | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - uses: actions-rs/toolchain@v1 | |
# with: | |
# toolchain: stable | |
# override: true | |
# - name: Run cargo publish | |
# run: | | |
# cd rustworkx-core | |
# cargo publish | |
# env: | |
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
sdist: | |
name: Build sdist | |
runs-on: ubuntu-latest | |
# needs: ["build_wheels"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: '3.x' | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Install deps | |
run: pip install -U twine setuptools-rust | |
- name: Build sdist | |
run: python setup.py sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: ./dist/* | |
- name: Upload to PyPI | |
run: twine upload ./dist/* | |
env: | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
TWINE_USERNAME: __token__ | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: '3.x' | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install cibuildwheel twine wheel | |
- name: Build wheels | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- -y" | |
CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"' | |
# CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.9 | |
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64:latest | |
CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2014_i686:latest | |
CIBW_SKIP: cp36-* pp* *win32 *musl* | |
CIBW_PRERELEASE_PYTHONS: True | |
CIBW_BEFORE_BUILD: pip install -U setuptools-rust | |
- name: Upload to PyPI | |
run: twine upload ./wheelhouse/*.whl | |
env: | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
TWINE_USERNAME: __token__ | |
build_wheels_aarch64: | |
name: Build linux aarch64 wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: '3.x' | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: all | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install cibuildwheel twine | |
- name: Build wheels | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- -y" | |
CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"' | |
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.9 | |
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64:latest | |
CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2014_i686:latest | |
CIBW_SKIP: cp36-* pp* *win32 *musl* | |
CIBW_PRERELEASE_PYTHONS: True | |
CIBW_BEFORE_BUILD: pip install -U setuptools-rust | |
# CIBW_TEST_REQUIRES: numpy scipy pandas requests | |
# CIBW_TEST_COMMAND: python -m unittest discover {project}/tests/ | |
CIBW_ARCHS_LINUX: aarch64 | |
# - uses: actions/upload-artifact@v4 | |
# with: | |
# path: ./wheelhouse/*.whl | |
- name: Upload to PyPI | |
run: twine upload ./wheelhouse/*.whl | |
env: | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
TWINE_USERNAME: __token__ | |
## mac arm64 build shipped with [email protected]. not extra builds for arm64 now | |
# build-mac-arm-wheels: | |
# name: Build wheels on macos for arm | |
# runs-on: macos-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Build wheels | |
# uses: joerick/[email protected] | |
# env: | |
# CIBW_BEFORE_ALL: rustup target add aarch64-apple-darwin | |
# CIBW_ARCHS_MACOS: arm64 | |
# CIBW_PRERELEASE_PYTHONS: True | |
# CIBW_BEFORE_BUILD: pip install -U setuptools-rust | |
# CIBW_ENVIRONMENT: CARGO_BUILD_TARGET="aarch64-apple-darwin" PYO3_CROSS_LIB_DIR="/Library/Frameworks/Python.framework/Versions/$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))')/lib/python$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))')" | |
# # - uses: actions/upload-artifact@v4 | |
# # with: | |
# # path: ./wheelhouse/*.whl | |
# - uses: actions/setup-python@v5 | |
# name: Install Python | |
# with: | |
# python-version: '3.10' | |
# - name: Install twine | |
# run: | | |
# python -m pip install twine | |
# - name: Upload to PyPI | |
# run: twine upload ./wheelhouse/*.whl | |
# env: | |
# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
# TWINE_USERNAME: __token__ | |
build-win32-wheels: | |
name: Build wheels on win32 | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: '3.x' | |
architecture: 'x86' | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
target: i686-pc-windows-msvc | |
- name: Force win32 rust | |
run: rustup default stable-i686-pc-windows-msvc | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install cibuildwheel twine | |
- name: Build wheels | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.9 | |
CIBW_SKIP: cp36-* pp* *amd64 *musl* | |
CIBW_PRERELEASE_PYTHONS: True | |
CIBW_BEFORE_BUILD: pip install -U setuptools-rust | |
# CIBW_TEST_REQUIRES: numpy scipy pandas requests | |
# CIBW_TEST_COMMAND: python -m unittest discover {project}/tests/ | |
# - uses: actions/upload-artifact@v4 | |
# with: | |
# path: ./wheelhouse/*.whl | |
- name: Upload to PyPI | |
run: twine upload ./wheelhouse/*.whl | |
env: | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
TWINE_USERNAME: __token__ |