zond-engine 0.6.1

A lightweight, fast, and highly concurrent networking backend for packet crafting, protocol fingerprinting, and host discovery.
Documentation
name: Build Zond

on:
  release:
    types: [published]
  push:
    branches: [ "main" ]
    paths:
      - 'src/**'
      - 'tests/**'
      - 'Cargo.toml'
      - 'Cargo.lock'
      - '.github/workflows/build.yml'
  pull_request:
    branches: [ "main" ]
    paths:
      - 'src/**'
      - 'tests/**'
      - 'Cargo.toml'
      - 'Cargo.lock'
      - '.github/workflows/build.yml'

permissions:
  contents: write

jobs:
  build:
    name: Build on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false 
      matrix:
        os: [ubuntu-latest, macos-latest]

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

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

      - name: Setup Rust Cache
        uses: Swatinem/rust-cache@v2

      - name: Run Tests
        run: cargo test

      - name: Build Release Binary
        if: github.event_name == 'release'
        run: cargo build --release

      - name: Package MacOS Binary
        if: matrix.os == 'macos-latest' && github.event_name == 'release'
        run: |
          cd target/release
          zip zond-macos.zip zond

      - name: Package Linux Binary
        if: matrix.os == 'ubuntu-latest' && github.event_name == 'release'
        run: |
          cd target/release
          tar -czf zond-linux.tar.gz zond

      - name: Build Debian Package
        if: matrix.os == 'ubuntu-latest' && github.event_name == 'release'
        run: |
          cargo install cargo-deb
          cargo deb -p zond-cli

      - name: Upload Release Assets
        if: github.event_name == 'release'
        uses: softprops/action-gh-release@v2
        with:
          files: |
            target/release/zond-macos.zip
            target/release/zond-linux.tar.gz
            target/debian/*.deb