69 lines
1.6 KiB
YAML
69 lines
1.6 KiB
YAML
name: Upload Python Package
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
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@v3
|
|
- uses: actions/setup-python@v4
|
|
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: "cp37-* cp38-* cp39-* cp310-* cp311-*"
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
path: dist/*.whl
|
|
|
|
build_sdist:
|
|
name: Build sdist
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.x'
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install setuptools "cython >= 0.28"
|
|
- name: Build sdist
|
|
run: |
|
|
python setup.py build
|
|
python setup.py sdist
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
path: dist/*
|
|
|
|
publish:
|
|
name: Publish to PyPI
|
|
needs: [build_wheels, build_sdist]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: artifact
|
|
path: dist
|
|
- name: Publish to PyPI
|
|
uses: pypa/gh-action-pypi-publish@master
|
|
with:
|
|
user: __token__
|
|
password: ${{ secrets.PYPI_PASSWORD }}
|