cridecoder 0.1.0

CRI codec library for ACB/AWB, HCA audio, and USM video extraction
Documentation
name: Release Python

on:
  release:
    types: [published]
  workflow_dispatch:

permissions:
  contents: read

jobs:
  # ──────────────────────────────────────────────
  # Build wheels for Linux (x86_64, aarch64)
  # ──────────────────────────────────────────────
  linux:
    runs-on: ${{ matrix.platform.runner }}
    strategy:
      matrix:
        platform:
          - runner: ubuntu-latest
            target: x86_64
          - runner: ubuntu-latest
            target: aarch64
        python:
          - "3.9"
          - "3.10"
          - "3.11"
          - "3.12"
          - "3.13"
          - "3.14"
          - "3.14t"
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python }}
          allow-prereleases: true
      - name: Build wheels
        uses: PyO3/maturin-action@v1
        with:
          target: ${{ matrix.platform.target }}
          args: --release --out dist
          sccache: "true"
          manylinux: auto
      - name: Upload wheels
        uses: actions/upload-artifact@v4
        with:
          name: wheels-linux-${{ matrix.platform.target }}-${{ matrix.python }}
          path: dist

  # ──────────────────────────────────────────────
  # Build wheels for macOS (x86_64, aarch64)
  # ──────────────────────────────────────────────
  macos:
    runs-on: ${{ matrix.platform.runner }}
    strategy:
      matrix:
        platform:
          - runner: macos-13
            target: x86_64
          - runner: macos-14
            target: aarch64
        python:
          - "3.9"
          - "3.10"
          - "3.11"
          - "3.12"
          - "3.13"
          - "3.14"
          - "3.14t"
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python }}
          allow-prereleases: true
      - name: Build wheels
        uses: PyO3/maturin-action@v1
        with:
          target: ${{ matrix.platform.target }}
          args: --release --out dist
          sccache: "true"
      - name: Upload wheels
        uses: actions/upload-artifact@v4
        with:
          name: wheels-macos-${{ matrix.platform.target }}-${{ matrix.python }}
          path: dist

  # ──────────────────────────────────────────────
  # Build wheels for Windows (x86_64)
  # ──────────────────────────────────────────────
  windows:
    runs-on: windows-latest
    strategy:
      matrix:
        python:
          - "3.9"
          - "3.10"
          - "3.11"
          - "3.12"
          - "3.13"
          - "3.14"
          - "3.14t"
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python }}
          allow-prereleases: true
      - name: Build wheels
        uses: PyO3/maturin-action@v1
        with:
          target: x64
          args: --release --out dist
          sccache: "true"
      - name: Upload wheels
        uses: actions/upload-artifact@v4
        with:
          name: wheels-windows-x64-${{ matrix.python }}
          path: dist

  # ──────────────────────────────────────────────
  # Build source distribution
  # ──────────────────────────────────────────────
  sdist:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Build sdist
        uses: PyO3/maturin-action@v1
        with:
          command: sdist
          args: --out dist
      - name: Upload sdist
        uses: actions/upload-artifact@v4
        with:
          name: wheels-sdist
          path: dist

  # ──────────────────────────────────────────────
  # Publish all wheels + sdist to PyPI
  # ──────────────────────────────────────────────
  publish:
    name: Publish to PyPI
    runs-on: ubuntu-latest
    needs: [linux, macos, windows, sdist]
    if: github.event_name == 'release'
    environment:
      name: pypi
      url: https://pypi.org/p/cridecoder
    permissions:
      id-token: write
    steps:
      - uses: actions/download-artifact@v4
        with:
          pattern: wheels-*
          merge-multiple: true
          path: dist/
      - name: Publish to PyPI
        uses: PyO3/maturin-action@v1
        with:
          command: upload
          args: --non-interactive --skip-existing dist/*