From 075df310c61be683f69fd12864eb9ff327215ade Mon Sep 17 00:00:00 2001 From: Duc Le Date: Thu, 23 Apr 2020 14:51:57 +0100 Subject: [PATCH] Add github actions to build wheels --- .github/workflows/build_python.yml | 70 ++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/build_python.yml diff --git a/.github/workflows/build_python.yml b/.github/workflows/build_python.yml new file mode 100644 index 0000000..887d856 --- /dev/null +++ b/.github/workflows/build_python.yml @@ -0,0 +1,70 @@ +# Adapted from https://github.com/RalfG/python-wheels-manylinux-build/blob/master/full_workflow_example.yml +name: Python package build and publish + +on: + release: + types: [created] + +jobs: + deploy_linux: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + + - name: Install python dependencies + run: | + python -m pip install --upgrade pip + pip install twine + + - name: Build manylinux wheels + uses: RalfG/python-wheels-manylinux-build@v0.2.2-manylinux2010_x86_64 + with: + python-versions: 'cp27-cp27mu cp35-cp35m cp36-cp36m cp37-cp37m cp38-cp38' + build-requirements: 'cmake' + system-packages: '' + package-path: '' + pip-wheel-args: '--no-deps' + + - name: Publish wheels to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + twine upload wheelhouse/*-manylinux*.whl + + deploy_windows: + runs-on: windows-latest + + strategy: + matrix: + python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8' ] + + name: Python ${{ matrix.python-version }} deployment + + steps: + - uses: actions/checkout@v2 + + - name: Setup python + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + + - name: Build and publish wheels to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py bdist_wheel + twine upload dist/*