openheim 0.2.1

A fast, multi-provider LLM agent runtime written in Rust
Documentation
name: Release

on:
  release:
    types: [published]

env:
  CARGO_TERM_COLOR: always
  BINARY_NAME: openheim

jobs:
  build:
    name: Build ${{ matrix.target }}
    runs-on: ${{ matrix.os }}
    permissions:
      contents: write
    strategy:
      fail-fast: false
      matrix:
        include:
          # Linux 64-bit Intel/AMD
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
          # Linux 64-bit ARM (Raspberry Pi, AWS Graviton)
          - target: aarch64-unknown-linux-gnu
            os: ubuntu-latest
            use_cross: true
          # macOS Intel (Older Macs)
          - target: x86_64-apple-darwin
            os: macos-latest
          # macOS Apple Silicon (M1, M2, M3, M4 Macs)
          - target: aarch64-apple-darwin
            os: macos-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: 1.92.0
          targets: ${{ matrix.target }}

      - uses: Swatinem/rust-cache@v2
        with:
          key: release-${{ matrix.target }}

      - name: Install cross
        if: matrix.use_cross
        uses: taiki-e/install-action@v2
        with:
          tool: cross

      - name: Build
        run: |
          if [ "${{ matrix.use_cross }}" = "true" ]; then
            cross build --release --target ${{ matrix.target }}
          else
            cargo build --release --target ${{ matrix.target }}
          fi

      - name: Package
        shell: bash
        run: |
          VERSION=${{ github.event.release.tag_name }}
          ARCHIVE="${{ env.BINARY_NAME }}-${VERSION}-${{ matrix.target }}.tar.gz"
          tar -czf "${ARCHIVE}" -C "target/${{ matrix.target }}/release" "${{ env.BINARY_NAME }}"
          echo "ARCHIVE=${ARCHIVE}" >> $GITHUB_ENV

      - name: Upload to release
        uses: softprops/action-gh-release@v2
        with:
          files: ${{ env.ARCHIVE }}