Skip to content

build

build #101

Workflow file for this run

name: build
on:
push:
tags:
- "maro-[0-9]+\\.[0-9]+\\.*"
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel twine
- name: Install build dependencies
run: |
pip install -r maro/requirements.build.txt
- name: Compile cython files
run: |
cython ./maro/backends/backend.pyx ./maro/backends/np_backend.pyx ./maro/backends/raw_backend.pyx ./maro/backends/frame.pyx --cplus -3 -E NODES_MEMORY_LAYOUT=ONE_BLOCK -X embedsignature=True
- name: Build wheel on Windows and macOS
if: runner.os == 'Windows' || runner.os == 'macOS'
run: |
python setup.py bdist_wheel
- name: Build source package on Windows
if: runner.os == 'Windows' && matrix.python-version == '3.7'
run: |
python setup.py sdist
- name: Build manylinux wheel
if: runner.os == 'Linux' && matrix.python-version == '3.7'
uses: RalfG/python-wheels-manylinux-build@v0.3.1-manylinux2010_x86_64
env:
GITHUB_BUILD_ACTION: True
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39'
build-requirements: 'numpy==1.21.6'
system-packages: 'libffi-devel'
pre-build-command: 'export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH'
pip-wheel-args: '-w ./wheelhouse' # save wheel packages to wheelhouse folder
- name: Move valid packages to dist folder for manylinux
if: runner.os == 'Linux' && matrix.python-version == '3.7'
run: |
mkdir -p dist
cp wheelhouse/pymaro-*-manylinux*.whl dist
- name: Upload linux wheel to artifact
uses: actions/upload-artifact@v2
with:
name: local-wheels
path: |
dist/*.whl
dist/*.gz
- name: Publish wheels to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
if: (runner.os == 'Linux' && matrix.python-version == '3.7') || (runner.os == 'Windows' || runner.os == 'macOS')
run: |
twine upload --verbose dist/*.whl