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:
|
||||
release:
|
||||
types: [created]
|
||||
types: [published]
|
||||
|
||||
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
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
|
@ -16,11 +44,25 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install setuptools "cython >= 0.28" twine
|
||||
- name: Build and publish
|
||||
env:
|
||||
TWINE_USERNAME: __token__
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
||||
pip install setuptools "cython >= 0.28"
|
||||
- name: Build sdist
|
||||
run: |
|
||||
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 }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue