speed-cli 1.0.0

Comprehensive multi-protocol network performance testing CLI (TCP, UDP, QUIC, HTTP/1.1, HTTP/2, h2c, HTTP/3)
name: release-binaries

# Fires when release-plz (or a manual tag) publishes a GitHub Release.
on:
  release:
    types: [published]

permissions:
  contents: write

jobs:
  upload:
    name: ${{ matrix.target }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      # Native targets only. HTTP/3 + aws-lc-rs make musl / cross targets
      # fragile; add aarch64-linux / musl once they are confirmed to build.
      matrix:
        include:
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
          - target: aarch64-apple-darwin
            os: macos-latest
          - target: x86_64-apple-darwin
            os: macos-13
          - target: x86_64-pc-windows-msvc
            os: windows-latest
    steps:
      - uses: actions/checkout@v4
      # aws-lc-rs builds aws-lc-sys via CMake on Windows, which needs a
      # discoverable MSVC toolchain plus NASM (see ci.yml for the same setup).
      - name: Set up MSVC environment (Windows)
        if: runner.os == 'Windows'
        uses: ilammy/msvc-dev-cmd@v1
      - name: Install NASM (Windows)
        if: runner.os == 'Windows'
        uses: ilammy/setup-nasm@v1
      - uses: taiki-e/upload-rust-binary-action@v1
        with:
          bin: speed-cli
          target: ${{ matrix.target }}
          tar: unix
          zip: windows
          checksum: sha256
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  # Once binaries are uploaded, bump the formula in the external Homebrew tap.
  # This no-ops cleanly until the maintainer provisions the HOMEBREW_TAP_TOKEN
  # secret and seeds an initial Formula/speed-cli.rb in justin13888/homebrew-tap
  # (one-time setup documented in CONTRIBUTING.md).
  bump-homebrew:
    name: Bump Homebrew tap
    needs: upload
    runs-on: ubuntu-latest
    steps:
      # secrets can't be used in a job-level `if:`, so gate on a step output.
      - name: Check for tap token
        id: gate
        env:
          TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
        run: echo "enabled=${{ env.TAP_TOKEN != '' }}" >> "$GITHUB_OUTPUT"
      - name: Bump formula
        if: steps.gate.outputs.enabled == 'true'
        uses: dawidd6/action-homebrew-bump-formula@v7
        with:
          token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
          tap: justin13888/homebrew-tap
          formula: speed-cli
          tag: ${{ github.event.release.tag_name }}