Skip to content

FreeCAD compatible wheels (#154) #29

FreeCAD compatible wheels (#154)

FreeCAD compatible wheels (#154) #29

Workflow file for this run

name: Build Package
on: push
jobs:
build:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
pip install Cython==0.29.32 --config-settings="--install-option=--no-cython-compile"
pip install cibuildwheel
python -c "import sys; \
py_ver = sys.version_info; \
numpy_version = 'numpy==1.19.3' if py_ver.minor == 8 else \
'numpy==1.26.2' if py_ver.minor == 9 or py_ver.minor == 10 else \
'numpy==1.24.2' if py_ver.minor == 11 else 'numpy'; \
print(numpy_version); \
" | xargs pip install
# For the moment the sdist build will be disabled.
# - name: Build sdist
# run: python setup.py sdist --formats=zip
# The env variable CIBW_BUILD is set here to be able to format matrix.python-version correctly
- name: Set CIBW_BUILD environment variable using Python
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: python ./.github/scripts/set_cibw_build_env.py
- name: Build wheels
run: |
python -m cibuildwheel --output-dir dist/
env:
# CIBW_BUILD: "cp${{ matrix.python-version }}*"
CIBW_SKIP: "*_i686 *musllinux* pp* *win32"
- name: Upload Distributions
uses: actions/upload-artifact@v3
with:
name: dist
path: |
dist/*.whl
dist/*.tar.gz
dist/*.zip
retention-days: 7
publish:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v2
- name: Publish distribution
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}