name: Python Wheels

on:
  push:
    branches:
      - main
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

env:
  IROH_FORCE_STAGING_RELAYS: "1"
  
jobs:
  manylinux:
    runs-on: ${{ matrix.runner }}
    container: ${{ matrix.container }}
    strategy:
      matrix:
        name: [ubuntu-latest, ubuntu-arm-latest]
        include:
          - name: ubuntu-latest
            python: 3.11
            os: ubuntu-latest
            release-os: manylinux_2_28
            release-arch: x86_64
            container: quay.io/pypa/manylinux_2_28_x86_64
            runner: [ubuntu-latest]
          - name: ubuntu-arm-latest
            python: 3.11
            os: ubuntu-latest
            release-os: manylinux_2_28
            release-arch: aarch64
            container: quay.io/pypa/manylinux_2_28_aarch64
            runner: [self-hosted, linux, ARM64]
    steps:
      - uses: actions/checkout@v4
      - name: Install stable rust
        run: curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
      - name: Install maturin & uniffi-bindgen
        run: |
          /opt/python/cp311-cp311/bin/pip install -U maturin uniffi-bindgen
      - name: Build wheel
        run: |
          source $HOME/.cargo/env
          PATH=/opt/python/cp311-cp311/bin:$PATH
          export PATH
          maturin --version
          maturin build --release --manylinux 2_28
      - name: Upload wheel
        uses: actions/upload-artifact@v4
        with:
          name: wheels-${{ matrix.release-os }}-${{ matrix.release-arch }}
          path: target/wheels/*.whl

  osx:
    runs-on: ${{ matrix.runner }}
    strategy:
      matrix:
        name: [macOS-latest, macOS-arm-latest]
        include:
          - name: macOS-latest
            python: 3.11
            os: macOS-latest
            release-os: darwin
            release-arch: x86_64
            runner: [macOS-13]
          - name: macOS-arm-latest
            python: 3.11
            os: macOS-latest
            release-os: darwin
            release-arch: aarch64
            runner: [self-hosted, macOS, ARM64]
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python }}
      - name: Install maturin & uniffi-bindgen
        run: |
          pip install -U maturin uniffi-bindgen
      - name: Build wheel
        run: |
          maturin --version
          maturin build --release
      - name: Upload wheel
        uses: actions/upload-artifact@v4
        with:
          name: wheels-${{ matrix.release-os }}-${{ matrix.release-arch }}
          path: target/wheels/*.whl
      
  windows:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: actions/setup-python@v4
        with:
          python-version: '3.11'
      - name: Install maturin & uniffi-bindgen
        run: |
          pip install -U maturin uniffi-bindgen
      - name: Build wheel
        run: |
          maturin --version
          maturin build --release
      - name: Upload wheel
        uses: actions/upload-artifact@v4
        with:
          name: wheels-windows-x86_64
          path: target/wheels/*.whl


Graph