Build(deps): Bump pypa/gh-action-pypi-publish from 1.8.12 to 1.8.14 (… #563
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.16.5 | |
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 | |
# upload to PyPI when a GitHub Release is created | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: artifact-* | |
path: dist | |
merge-multiple: true # download and extract all artifacts in the same directory | |
- uses: pypa/gh-action-pypi-publish@v1.8.14 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PYCALPHAD_TOKEN }} | |
# To test, uncomment the following: | |
# password: ${{ secrets.TEST_PYPI_PYCALPHAD_TOKEN }} | |
# repository_url: https://test.pypi.org/legacy/ |