Also build wheels with cibuildwheel
This commit is contained in:
parent
db01b9e7ff
commit
3a9b79ece2
2 changed files with 56 additions and 8 deletions
58
.github/workflows/publish-twine.yaml
vendored
58
.github/workflows/publish-twine.yaml
vendored
|
|
@ -2,10 +2,38 @@ name: Upload Python Package
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
build_wheels:
|
||||||
|
name: Build wheels on ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
name: Install Python
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
|
||||||
|
- name: Install cibuildwheel
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
python -m pip install cibuildwheel
|
||||||
|
- name: Build wheels
|
||||||
|
run: |
|
||||||
|
python -m cibuildwheel --output-dir dist
|
||||||
|
env:
|
||||||
|
CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-*"
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
path: dist/*.whl
|
||||||
|
|
||||||
|
build_sdist:
|
||||||
|
name: Build sdist
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
@ -16,11 +44,25 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install setuptools "cython >= 0.28" twine
|
pip install setuptools "cython >= 0.28"
|
||||||
- name: Build and publish
|
- name: Build sdist
|
||||||
env:
|
|
||||||
TWINE_USERNAME: __token__
|
|
||||||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
||||||
run: |
|
run: |
|
||||||
python setup.py sdist
|
python setup.py sdist
|
||||||
twine upload dist/*
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
path: dist/*
|
||||||
|
|
||||||
|
publish:
|
||||||
|
name: Publish to PyPI
|
||||||
|
needs: [build_wheels, build_sdist]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: artifact
|
||||||
|
path: dist
|
||||||
|
- name: Publish to PyPI
|
||||||
|
uses: pypa/gh-action-pypi-publish@master
|
||||||
|
with:
|
||||||
|
user: __token__
|
||||||
|
password: ${{ secrets.PYPI_PASSWORD }}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
[build-system]
|
||||||
|
requires = [
|
||||||
|
"setuptools",
|
||||||
|
"Cython",
|
||||||
|
]
|
||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
target_version = ["py36"]
|
target_version = ["py36"]
|
||||||
include = '\.pyi?$'
|
include = '\.pyi?$'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue