Skip to content

Merge pull request #10 from tsubramanian/patch-1 #140

Merge pull request #10 from tsubramanian/patch-1

Merge pull request #10 from tsubramanian/patch-1 #140

name: Build and upload to PyPI
# Build on every branch push, tag push, and pull request change:
on: push
jobs:
build_wheels:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7]
steps:
- uses: actions/checkout@v2
with:
# This allows the setuptools_scm library to discover the tag version from git
fetch-depth: 0
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: ${{ matrix.python-version }}
- name: Build wheel
env:
CIBW_SKIP: cp27-* pp27-* pp36-*
CIBW_TEST_COMMAND: python -c "import wbia_pie; from wbia_pie.__main__ import main; main()"
run: |
python -m pip install cibuildwheel==1.4.2
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.8'
- name: Build sdist
run: |
pip install scikit-build
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
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
# To test: repository_url: https://test.pypi.org/legacy/