killer 1.4.0

A Rust security platform: static analysis, the .klr test language, a parallel test framework, project intelligence, code review, and a CI gate.
Documentation
name: Release

# Tagging `vX.Y.Z` builds cross-platform binaries and publishes a GitHub Release
# with notes drawn from CHANGELOG.md. No manual release steps required.

on:
  push:
    tags: ["v*"]
  # Dispatchable so the crates.io publish can be run after the token secret is
  # added, without having to invent a version bump or re-push a tag.
  workflow_dispatch:

permissions:
  contents: write

jobs:
  build:
    name: Build ${{ matrix.target }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
            target: x86_64-unknown-linux-gnu
          - os: macos-latest
            target: x86_64-apple-darwin
          - os: macos-latest
            target: aarch64-apple-darwin
          - os: windows-latest
            target: x86_64-pc-windows-msvc
    steps:
      - uses: actions/checkout@v4

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

      - name: Build
        run: cargo build --release --target ${{ matrix.target }}

      - name: Package (unix)
        if: runner.os != 'Windows'
        run: |
          bin="target/${{ matrix.target }}/release/killer"
          tar -czf "killer-${{ matrix.target }}.tar.gz" -C "$(dirname "$bin")" killer
          shasum -a 256 "killer-${{ matrix.target }}.tar.gz" > "killer-${{ matrix.target }}.tar.gz.sha256"

      - name: Package (windows)
        if: runner.os == 'Windows'
        shell: pwsh
        run: |
          $bin = "target/${{ matrix.target }}/release/killer.exe"
          Compress-Archive -Path $bin -DestinationPath "killer-${{ matrix.target }}.zip"
          (Get-FileHash "killer-${{ matrix.target }}.zip" -Algorithm SHA256).Hash | Out-File "killer-${{ matrix.target }}.zip.sha256"

      - name: Upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: killer-${{ matrix.target }}
          path: |
            killer-${{ matrix.target }}.*

  release:
    name: Publish release
    needs: build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Download artifacts
        uses: actions/download-artifact@v4
        with:
          path: dist
          merge-multiple: true

      - name: Extract release notes from CHANGELOG
        id: notes
        run: |
          version="${GITHUB_REF_NAME#v}"
          awk -v v="$version" '
            $0 ~ "^## \\[" v "\\]" {flag=1; next}
            /^## \[/ {flag=0}
            flag {print}
          ' CHANGELOG.md > release-notes.md
          if [ ! -s release-notes.md ]; then echo "Release $GITHUB_REF_NAME" > release-notes.md; fi

      - name: Publish GitHub Release
        uses: softprops/action-gh-release@v2
        with:
          body_path: release-notes.md
          files: dist/*
          generate_release_notes: false

  publish-crate:
    name: Publish to crates.io
    needs: build
    runs-on: ubuntu-latest
    env:
      # Add a repository secret named CARGO_REGISTRY_TOKEN (a crates.io API
      # token) to enable this. Until then the step below skips cleanly.
      CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
    steps:
      - uses: actions/checkout@v4

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

      - name: Publish to crates.io
        run: |
          if [ -z "${CARGO_REGISTRY_TOKEN}" ]; then
            echo "CARGO_REGISTRY_TOKEN not set — skipping crates.io publish."
            echo "Add the secret in Settings → Secrets and variables → Actions to enable it."
            exit 0
          fi
          cargo publish