Skip to content

Release

Release #99

Workflow file for this run

# 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/[email protected]
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@v4
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/[email protected]
# with:
# packages_dir: wheelhouse