Update README.md #31
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 and upload to PyPI | |
on: [push, pull_request] | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest] | |
python-version: ['3.10'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Run test in develop mode | |
run: | | |
python -m pip install opencv-python pytest | |
python setup.py develop | |
python --version | |
pytest | |
- name: Build wheels for Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
docker run --rm -v $(pwd):/io quay.io/pypa/manylinux_2_24_x86_64 \ | |
/bin/bash -c "python3 -m pip install -U setuptools wheel && cd /io && python3 setup.py bdist_wheel -d dist && auditwheel repair dist/*.whl -w /io/wheelhouse" | |
- name: Build wheels for Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
pip install -U wheel setuptools | |
python setup.py bdist_wheel -d wheelhouse | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build sdist | |
run: python setup.py sdist -d dist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@v1.4.2 | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} | |
skip_existing: true |