change OS to latest #26
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 publish | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] | |
steps: | |
- uses: actions/checkout@v4 | |
# Used to host cibuildwheel | |
- uses: actions/setup-python@v5 | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel | |
- name: Build wheels | |
run: python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wheelhouse_wheel_${{ matrix.os }} | |
path: wheelhouse/*.whl | |
retention-days: 1 | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
run: pipx run build --sdist --outdir wheelhouse | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wheelhouse_sdist | |
path: wheelhouse/*.tar.gz | |
retention-days: 1 | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
name: Upload source distributions and wheels to Pypi | |
runs-on: ubuntu-latest | |
# Upload to PyPI on every tag | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Download artifacts produced during the build_wheels and build_sdist jobs | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
path: wheelhouse | |
- name: Display structure of downloaded files | |
run: ls -R | |
working-directory: wheelhouse | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages_dir: wheelhouse/ |