Build python wheels #1
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
name: Build python wheels | |
on: | |
workflow_dispatch | |
jobs: | |
build-sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
- name: Setup pip | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build | |
- name: Build sdist | |
run: python -m build --sdist | |
- name: Upload distributions | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-sdist | |
path: dist/ | |
build-wheels: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
with: | |
output-dir: dist | |
env: | |
CIBW_BUILD: cp3* | |
CIBW_SKIP: "*win32 *i686 *musllinux*" | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel" | |
CIBW_CONFIG_SETTINGS: "cmake.define.ENABLE_PYTHON_EMBED=OFF" | |
CIBW_TEST_REQUIRES: pytest | |
CIBW_TEST_COMMAND: > | |
cd {package} && | |
pytest python/test | |
- name: Upload distributions | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-dists | |
path: dist/ | |
pypi-publish: | |
runs-on: ubuntu-latest | |
needs: | |
- build-sdist | |
- build-wheels | |
permissions: | |
id-token: write | |
# Dedicated environments with protections for publishing are strongly recommended. | |
environment: | |
name: pypi | |
url: https://pypi.org/project/pygenten/ | |
steps: | |
- name: Retrieve source distribution | |
uses: actions/download-artifact@v4 | |
with: | |
name: release-sdist | |
path: dist/ | |
- name: Retrieve release distributions | |
uses: actions/download-artifact@v4 | |
with: | |
name: release-dists | |
path: dist/ | |
- name: Publish release distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true | |