Update setup.py and MANIFEST.in to include environment files and add … #109
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
# This workflow will build and (if release) publish Python distributions to PyPI | |
# For more information see: | |
# - https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
# - https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | |
# | |
name: build-publish | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
release: | |
types: [published] | |
jobs: | |
build-wheels: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
python: 37 | |
platform: manylinux_x86_64 | |
- os: ubuntu-latest | |
python: 38 | |
platform: manylinux_x86_64 | |
- os: ubuntu-latest | |
python: 39 | |
platform: manylinux_x86_64 | |
- os: ubuntu-latest | |
python: 310 | |
platform: manylinux_x86_64 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.6.0 | |
env: | |
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform }} | |
CIBW_ARCHS: all | |
CIBW_BUILD_VERBOSITY: 1 | |
- name: Store wheels | |
uses: actions/upload-artifact@v2 | |
with: | |
path: ./wheelhouse/*.whl | |
build-src: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build src | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
python setup.py sdist | |
- name: Store src | |
uses: actions/upload-artifact@v2 | |
with: | |
path: dist/*.tar.gz | |
build-wheels-ms: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: [ '3.7', '3.8', '3.9', '3.10' ] | |
include: | |
- os: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@v1.0.2 | |
- name: Build wheel | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
pip install wheel cmake-build-extension | |
pip wheel . --no-deps -w wheelhouse/ | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
publish: | |
runs-on: ubuntu-latest | |
needs: | |
- build-wheels | |
- build-wheels-ms | |
- build-src | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- name: Download dists | |
uses: actions/download-artifact@v2 | |
with: | |
name: artifact | |
path: dist | |
- name: Publish | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |