Merge pull request #54 from Dobatymo/update-setup-info #179
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: Python package | |
on: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
release: | |
types: | |
- published | |
jobs: | |
build-wheels: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-13, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pypa/cibuildwheel@v2.16.5 | |
env: | |
# skip pypy as numpy does not support it well | |
CIBW_SKIP: cp36-* pp* | |
CIBW_ARCHS: auto64 | |
CIBW_BEFORE_ALL_MACOS: brew install llvm libomp | |
CIBW_ENVIRONMENT_MACOS: CC="clang" CXX="clang++" PATH="/usr/local/opt/llvm/bin:$PATH" LDFLAGS="-L/usr/local/opt/llvm/lib" CPPFLAGS="-I/usr/local/opt/llvm/include" | |
CIBW_BEFORE_BUILD_MACOS: clang --version | |
CIBW_BUILD_VERBOSITY: 1 | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build-sdist: | |
needs: build-wheels | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Build sdist | |
run: | | |
python -m pip install build | |
python -m build --sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./dist/*.tar.gz | |
upload-pypi: | |
if: github.event_name == 'release' && github.event.action == 'published' | |
needs: [build-wheels, build-sdist] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 |