update fix #40
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 CIBuild and Upload Wheels | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
test_py: | ||
description: 'Publish package to test PY Repository' | ||
required: true | ||
default: 'false' | ||
main_py: | ||
description: 'Publish package to main PY Repository' | ||
required: true | ||
default: 'false' | ||
test_package: | ||
description: 'Test package within workflow' | ||
required: true | ||
default: 'false' | ||
jobs: | ||
build: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2019, macOS-12] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
# Used to host cibuildwheel | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
# macOS workaround to not use Accelerate: | ||
# https://github.com/numpy/numpy/issues/15947 | ||
- name: Setup Openblas on macOS | ||
if: matrix.os == 'macOS-12' | ||
run: brew install openblas | ||
- name: Install dependencies and cibuildwheel | ||
run: | | ||
python -m pip install cibuildwheel==2.16.0 | ||
python -m pip install -r requirements-dev.txt | ||
- name: Build wheels MACOS | ||
if: matrix.os == 'macOS-12' | ||
run: OPENBLAS="$(brew --prefix openblas)" python -m cibuildwheel --output-dir dist | ||
env: | ||
# Disable building PyPy wheels on all platforms: "pp* | ||
# Disable 32-bit compilation: *-win32 | ||
# Disable musllinux: *-musllinux* | ||
# Windows workaround to avoid setuptools error: | ||
# https://github.com/duckdb/duckdb/pull/3376 | ||
CIBW_SKIP: "pp* *-win32 *-manylinux_i686 *-musllinux* cp36-* cp37-* | ||
if: matrix.os == 'windows-2019' | ||
SETUPTOOLS_USE_DISTUTILS: 'stdlib' | ||
- name: Build wheels Non-MACOS | ||
if: matrix.os != 'macOS-12' | ||
run: python -m cibuildwheel --output-dir dist | ||
env: | ||
# Disable building PyPy wheels on all platforms: "pp* | ||
# Disable 32-bit compilation: *-win32 | ||
# Disable musllinux: *-musllinux* | ||
# Windows workaround to avoid setuptools error: | ||
# https://github.com/duckdb/duckdb/pull/3376 | ||
CIBW_SKIP: "pp* *-win32 *-manylinux_i686 *-musllinux* cp36-* cp37-* | ||
if: matrix.os == 'windows-2019' | ||
SETUPTOOLS_USE_DISTUTILS: 'stdlib' | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: ./dist/*.whl | ||
if-no-files-found: error | ||
- name: Install software | ||
if: ${{ github.event.inputs.test_package == 'true' }} | ||
run: pip install --find-links=${{github.workspace}}/dist/ numpymaxflow | ||
- name: Test import | ||
if: ${{ github.event.inputs.test_package == 'true' }} | ||
run: python -c "import numpymaxflow" | ||
build_sdist: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
pip install wheel setuptools | ||
pip install -r requirements-dev.txt | ||
- name: Build source dist | ||
run: python setup.py sdist | ||
- name: Upload Python Dist | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist/ | ||
if-no-files-found: error | ||
publish_pypi: | ||
runs-on: ubuntu-20.04 | ||
needs: | ||
- build | ||
- build_sdist | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist/ | ||
- name: Publish distribution to Test PyPI | ||
if: ${{ github.event.inputs.test_py == 'true' }} | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
- name: Publish distribution to PyPI | ||
if: ${{ github.event.inputs.main_py == 'true' }} | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |