flowsdk 0.5.3

Safety-first, realistic, behavior-predictable messaging SDK for MQTT and more.
Documentation
name: Publish to PyPI
permissions:
  contents: read

on:
  release:
    types: [published]

jobs:
  build_wheels:
    name: Build wheels on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Build and Prepare Bindings
        shell: bash
        run: |
          ./scripts/build_python_bindings.sh --release

      - name: Build wheels
        uses: pypa/cibuildwheel@v2
        with:
          package-dir: python/package
        env:
          CIBW_BEFORE_BUILD: "pip install setuptools wheel"
          # Linux specific: ensure library is copied correctly if needed
          # But our script handles the dylib placement.

      - uses: actions/upload-artifact@v4
        with:
          name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
          path: ./wheelhouse/*.whl

  upload_pypi:
    needs: [build_wheels]
    runs-on: ubuntu-latest
    environment:
      name: pypi
      url: https://pypi.org/p/flowsdk
    permissions:
      id-token: write
    steps:
      - uses: actions/download-artifact@v4
        with:
          pattern: cibw-wheels-*
          path: dist
          merge-multiple: true

      - uses: pypa/gh-action-pypi-publish@release/v1
        with:
          password: ${{ secrets.PYPI_API_TOKEN }}