Workflow file for this run
This file contains hidden or 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 wheels, sdist, and upload to PyPI (only on release!) | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - "rc-v*.*.*" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| # macos-13 is an intel runner, macos-14 is apple silicon | |
| os: [ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-14] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Used to host cibuildwheel | |
| - name: Build wheel | |
| uses: pypa/cibuildwheel@v3.1.3 | |
| with: | |
| output-dir: wheelhouse | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cibw-wheels-${{ matrix.os }} | |
| path: ./wheelhouse/*.whl | |
| make-sdist: | |
| name: Make source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install libsemigroups | |
| run: source etc/make-libsemigroups.sh && sudo make install | |
| - name: Build SDist | |
| run: pipx run build --sdist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| # TODO(1): Add a TestPyPI step | |
| publish-to-pypi: | |
| if: ${{ github.event_name == 'release' || github.event_name == 'workflow_dispatch' }} | |
| name: Publish Python distribution to PyPI | |
| needs: | |
| - build-wheels | |
| - make-sdist | |
| runs-on: ubuntu-latest | |
| # TODO(1): Uncomment below and configure a publishing environment | |
| # See https://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/manage-environments | |
| # environment: | |
| # name: pypi | |
| # url: https://pypi.org/p/libsemigroups-pybind11/ | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download wheels and sdist artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| # Here, we could specify a name of an artifact, or a pattern that | |
| # matches the names of artifacts. However, by not specifying these | |
| # values, all of the artifacts from this run are downloaded (which is | |
| # what we want). | |
| # Destination path | |
| path: dist | |
| # If true, the downloaded artifacts will be in the same directory | |
| # specified by path. | |
| # If false, the downloaded artifacts will be extracted into individual | |
| # named directories within the specified path.' | |
| merge-multiple: true | |
| - name: List directory contents | |
| run: ls dist | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |