Build #46
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
name: Build | |
on: | |
create: | |
tags: | |
- v* | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
env: | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y && yum install -y openssl-devel" | |
CIBW_BEFORE_BUILD_LINUX: "pip3 install --upgrade keyrings.alt" | |
CIBW_ARCHS_LINUX: "auto aarch64" | |
CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"' | |
CIBW_SKIP: "cp36-* cp37-* pp* *-win32 *-musllinux*" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- if: runner.os == 'Windows' | |
run: | | |
echo 'PATH=/c/Python38:/c/Python38/Scripts:/c/Strawberry/perl/site/bin:/c/Strawberry/perl/bin:/c/Strawberry/c/bin:$PATH' >> $GITHUB_ENV | |
echo 'RUSTFLAGS=-Ctarget-feature=+crt-static' >> $GITHUB_ENV | |
echo 'RUSTFLAGS=-Ctarget-feature=+crt-static' >> $GITHUB_ENV | |
echo 'CIBW_BEFORE_BUILD=python -m pip install --upgrade pip' >> $GITHUB_ENV | |
- if: runner.os != 'Linux' | |
run: | | |
echo "CIBW_SKIP=$CIBW_SKIP cp38-*" >> $GITHUB_ENV # Also skip Python 3.7 as build is too slow | |
- if: runner.os != 'Linux' | |
name: Setup env when not using docker | |
run: | | |
python -m pip install --upgrade wheel setuptools setuptools-rust | |
- if: runner.os == 'Linux' | |
name: Set up QEMU | |
id: qemu | |
uses: docker/setup-qemu-action@v1 | |
with: | |
image: tonistiigi/binfmt:latest | |
platforms: arm64 | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: '3.7' | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install cibuildwheel | |
- name: Build wheels | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: '3.7' | |
- name: Install setuptools and setuptools-rust | |
run: | | |
python -m pip install --upgrade wheel setuptools setuptools-rust | |
- name: Build sdist | |
run: python setup.py 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/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.TWINE_PASSWORD }} |