v2.0.1 #100
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
# adapted from: https://github.com/pypa/cibuildwheel/tree/main/examples | |
name: Release | |
on: | |
release: | |
types: [ published ] | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
build_wheels_and_sdist: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04, macOS-12, windows-2019 ] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-tags: 'true' | |
fetch-depth: 0 | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Cythonize C-extensions | |
run: | | |
python3 -m pip install --upgrade pip cibuildwheel==2.19.2 | |
python3 -m pip install -r requirements-dev.txt | |
cythonize polyagamma/*.pyx | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.21.3 | |
with: | |
package-dir: . | |
output-dir: wheelhouse | |
config-file: "pyproject.toml" | |
- name: Build source distribution | |
if: ${{ matrix.os == 'ubuntu-20.04' }} | |
run: | | |
python3 -m pip install --upgrade pip cython==3.0.* build | |
cythonize polyagamma/*.pyx | |
python -m pip install build | |
python -m build --sdist | |
mv dist/*.gz wheelhouse | |
- name: Store the wheelhouse directory | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels_and_sdist | |
path: wheelhouse | |
if-no-files-found: error | |
upload_pypi: | |
needs: [ build_wheels_and_sdist ] | |
runs-on: ubuntu-20.04 | |
environment: | |
name: pypi | |
url: https://pypi.org/p/polyagamma | |
permissions: | |
id-token: write | |
steps: | |
- name: Pull built wheels and sdist | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheels_and_sdist | |
path: wheelhouse | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@v1.8.10 | |
with: | |
packages_dir: wheelhouse |