Version 0.3.1 #99
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
name: Build and upload to PyPI | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
build_wheels: | |
env: | |
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" | |
CIBW_ENVIRONMENT: "INCSTATSPY_EXCLUDE_TESTS=1 LD_LIBRARY_PATH=$(pwd)/build/src/incstats/src/incstats${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" | |
CIBW_SKIP: "pp39*-manylinux_i686 pp3[1-9][0-9]-manylinux_i686" | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# macos-13 is an intel runner, macos-14 is apple silicon | |
os: [macos-13, macos-14, ubuntu-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install GCC on macOS | |
if: startsWith(matrix.os, 'macos') | |
run: brew install gcc | |
- name: Set GCC as the compiler on macOS | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
export GCC_VERSION=$(brew list --versions gcc | awk '{print $2}' | awk -F. '{print $1}') | |
echo "CC=$(which gcc-${GCC_VERSION})" >> $GITHUB_ENV | |
echo "CXX=$(which g++-${GCC_VERSION})" >> $GITHUB_ENV | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.20.0 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-sdist | |
path: dist/*.tar.gz | |
pypi-publish: | |
name: Upload release to PyPI | |
needs: | |
- build_wheels | |
- build_sdist | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/incstatspy | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
steps: | |
- name: Download previouly generated artifacts. | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist/ | |
- name: Check dist folder | |
run: | | |
cp -r dist/cibw-wheels-*/* dist/ | |
rm -r dist/cibw-wheels-* | |
cp -r dist/cibw-sdist/* dist/ | |
rm -r dist/cibw-sdist | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1.10 |