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-plz

on:
  push:
    branches: [master]

permissions:
  contents: write
  pull-requests: write

jobs:
  # Opens/updates a "release" PR that bumps the version and updates CHANGELOG.md.
  release-pr:
    name: Release PR
    runs-on: ubuntu-latest
    concurrency:
      group: release-plz-${{ github.ref }}
      cancel-in-progress: false
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      # Prefer a GitHub App token: the default GITHUB_TOKEN can't trigger
      # downstream workflows, so a release PR opened with it wouldn't run CI, and
      # an on-merge release wouldn't fire the binary build. The app id lives in a
      # repo *variable* (secrets can't be read in `if:`); the private key is a
      # secret. When the app isn't configured we fall back to GITHUB_TOKEN so the
      # workflow still works — the release PR just opens without triggering CI.
      # One-time setup is documented in CONTRIBUTING.md.
      - uses: actions/create-github-app-token@v2
        id: app-token
        if: ${{ vars.RELEASE_PLZ_APP_ID != '' }}
        with:
          app-id: ${{ vars.RELEASE_PLZ_APP_ID }}
          private-key: ${{ secrets.RELEASE_PLZ_APP_PRIVATE_KEY }}
      - uses: release-plz/action@v0.5
        with:
          command: release-pr
        env:
          GITHUB_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}

  # When the release PR is merged, publishes the crate to crates.io, tags the
  # commit, and creates the GitHub Release (which triggers release-binaries.yml
  # to upload binaries and bump the Homebrew tap).
  release:
    name: Release
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: actions/create-github-app-token@v2
        id: app-token
        if: ${{ vars.RELEASE_PLZ_APP_ID != '' }}
        with:
          app-id: ${{ vars.RELEASE_PLZ_APP_ID }}
          private-key: ${{ secrets.RELEASE_PLZ_APP_PRIVATE_KEY }}
      - uses: release-plz/action@v0.5
        with:
          command: release
        env:
          GITHUB_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
          # Authenticates `cargo publish`. Required for the crates.io release;
          # add it as a repo secret (see CONTRIBUTING.md).
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}