git-bot-feedback 0.7.1

A library designed for CI tools that posts comments on a Pull Request.
Documentation
# This file is autogenerated by maturin v1.7.0
# To update, run
#
#    maturin generate-ci github
#
name: Python

on:
  push:
    branches: [main]
    paths:
      - '**/*.rs'
      - "!tests/*.rs"
      - bindings/python/pyproject.toml
      - .github/workflows/python.yml
    tags: ["git-bot-feedback-py/v*"]
  pull_request:
    branches: [main]
    paths:
      - '**/*.rs'
      - "!tests/*.rs"
      - bindings/python/pyproject.toml
      - .github/workflows/python.yml

permissions: {}

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') }}

jobs:
  wheels:
    runs-on: ${{ matrix.runner }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - runner: ubuntu-latest
            target: x86_64
          - runner: ubuntu-latest
            target: x86
          - runner: ubuntu-latest
            target: aarch64
          - runner: ubuntu-latest
            target: armv7
          - runner: ubuntu-latest
            target: s390x
          - runner: ubuntu-latest
            target: ppc64le
          - runner: ubuntu-latest
            target: x86_64
            manylinux: musllinux_1_2
          - runner: ubuntu-latest
            target: x86
            manylinux: musllinux_1_2
          - runner: ubuntu-latest
            target: aarch64
            manylinux: musllinux_1_2
          - runner: ubuntu-latest
            target: armv7
            manylinux: musllinux_1_2
          - runner: windows-latest
            target: x64
            py-arch: x64
          - runner: windows-latest
            target: x86
            py-arch: x86
          - runner: windows-11-arm
            target: aarch64
            py-arch: arm64
            # python 3.11 is the minimum version available for arm64 on windows.
            pyo3-feature: pyo3/abi3-py311
          - runner: macos-15-intel
            target: x86_64
          - runner: macos-15
            target: aarch64
    steps:
      - uses: actions/checkout@v7
        with:
          persist-credentials: false
      - uses: actions/setup-python@v6.2.0
        with:
          python-version: '3.x'
          architecture: ${{ matrix.py-arch || null }}
      - name: Build wheels
        uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
        with:
          target: ${{ matrix.target }}
          # Use the zig toolchain for all targets except linux ppc64le.
          # Note, this is meant to avoid build errors in aws-lc-sys crate, which compiles C code.
          # For using reqwest v0.13 with `default-tls` feature.
          args: >-
            --release
            --out dist
            --find-interpreter
            --manifest-path bindings/python/Cargo.toml
            --features ${{ matrix.pyo3-feature || 'pyo3/abi3-py310' }}
            ${{ runner.os == 'Linux' && matrix.target != 'ppc64le' && '--zig' || '' }}
          sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
          manylinux: ${{ matrix.manylinux || 'auto' }}
          # here we either install the ppc64le compiler/toolchain or install zig on all others
          # spell-checker: disable
          before-script-linux: |
            case "${{ matrix.target }}" in
              ppc64le)
                apt-get update
                apt-get install -y \
                  pkg-config \
                  gcc-powerpc64le-linux-gnu \
                  g++-powerpc64le-linux-gnu \
                  binutils-powerpc64le-linux-gnu \
                  libc6-dev-ppc64el-cross \
                  libfontconfig1-dev
                ;;
            esac
          # spell-checker: enable
      - name: Upload wheels
        uses: actions/upload-artifact@v7
        with:
          name: wheels-${{ runner.os }}-${{ matrix.target }}_${{ matrix.manylinux || '' }}
          path: dist

  sdist:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
        with:
          persist-credentials: false
      - name: Build sdist
        uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
        with:
          command: sdist
          args: --out dist --manifest-path bindings/python/Cargo.toml
      - name: Upload sdist
        uses: actions/upload-artifact@v7
        with:
          name: wheels-sdist
          path: dist

  release:
    name: Release
    runs-on: ubuntu-latest
    if: startsWith(github.ref, 'refs/tags/git-bot-feedback-py/v')
    needs: [wheels, sdist]
    permissions:
      id-token: write
    steps:
      - uses: actions/download-artifact@v8
        with:
          pattern: wheels-*
          path: dist
          merge-multiple: true
      - name: Publish to PyPI
        uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
        with:
          skip-existing: true

  check-dist:
    needs: [wheels, sdist]
    if: ${{ !startsWith(github.ref, 'refs/tags/git-bot-feedback-py/v') }}
    name: Check package dist
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v8
        with:
          pattern: wheels-*
          path: dist
          merge-multiple: true
      - uses: actions/setup-python@v6.2.0
        with:
          python-version: 3.x
      - name: Check distributions
        # spell-checker: disable-next-line
        run: pipx run twine check dist/*