Build(deps): Bump codecov/codecov-action from 3 to 4 #608
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
# Based on https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml | |
name: Build and deploy to PyPI | |
# Build on every branch push and pull request | |
# Also build (and deploy) when a GitHub Release is created | |
on: | |
push: | |
pull_request: | |
release: | |
types: | |
- published | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-2019, macos-11] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # fetch the entire repo history, required to guarantee versioneer will pick up the tags | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.19.0 | |
env: | |
# PyPy wheels not allowed because SciPy (build requirement) is not available | |
CIBW_BUILD: cp3*-* | |
CIBW_SKIP: cp35-* cp36-* cp37-* *-musllinux_* | |
CIBW_ARCHS_LINUX: auto64 | |
CIBW_ARCHS_MACOS: x86_64 universal2 arm64 | |
CIBW_ARCHS_WINDOWS: auto64 | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-wheels-${{ matrix.os }} | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: '3.8' | |
- run: pip install build | |
- name: Build sdist | |
run: python -m build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-source | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
# upload to PyPI when a GitHub Release is created | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: artifact-* | |
path: dist | |
merge-multiple: true # download and extract all artifacts in the same directory | |
- name: PyPI - Upload Artifacts to PyPI (Production) | |
uses: pypa/gh-action-pypi-publish@v1.8.14 | |
if: github.event_name == 'release' && github.event.action == 'published' | |
- name: TestPyPI - Upload Artifacts | |
uses: pypa/gh-action-pypi-publish@v1.8.14 | |
if: github.event_name == 'push' && github.ref_name == 'develop' | |
with: | |
repository-url: https://test.pypi.org/legacy/ |