name: build-python on: pull_request: push: branches: - master tags: - "flimlib-[0-9]+.*" jobs: wheels: name: wheels-${{ matrix.runner }} strategy: matrix: runner: - ubuntu-24.04 - windows-2025 - macos-15 runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@v4 - uses: pypa/cibuildwheel@v3.2.0 env: # For macOS, select all here and constrain in pyproject.toml CIBW_ARCHS_MACOS: x86_64 universal2 arm64 # Do not warn about the x86_64 portion of universal2 not being tested CIBW_TEST_SKIP: "*-macosx_universal2:x86_64" - uses: actions/upload-artifact@v4 with: name: ${{ matrix.runner }}-wheels path: wheelhouse/*.whl sdist: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # Do not pass --sdist to 'build' so that building from the sdist is # tested (at least on Ubuntu) - run: pipx run build - uses: actions/upload-artifact@v4 with: name: sdist path: dist/*.tar.gz pypi-upload: needs: - wheels - sdist runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v4 with: merge-multiple: true path: dist - run: ls dist # For the log. - uses: pypa/gh-action-pypi-publish@v1.13.0 if: >- github.event_name == 'push' && startsWith(github.ref, 'refs/tags/flimlib-') with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }}