maniac-killer 0.1.0

High-resource runaway process watchdog and remote executioner for macOS & Linux with AI agent immunity
name: Release

on:
  push:
    tags:
      - 'v*'

jobs:
  build:
    name: Build (${{ matrix.target }})
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - target: aarch64-apple-darwin
            os: macos-latest
            artifact_name: maniac-killer
            asset_name: maniac-killer-aarch64-apple-darwin
          - target: x86_64-apple-darwin
            os: macos-13
            artifact_name: maniac-killer
            asset_name: maniac-killer-x86_64-apple-darwin
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
            artifact_name: maniac-killer
            asset_name: maniac-killer-x86_64-unknown-linux-gnu

    steps:
    - uses: actions/checkout@v4
    - uses: dtolnay/rust-toolchain@stable
      with:
        targets: ${{ matrix.target }}
    - name: Build Binary
      run: cargo build --release --target ${{ matrix.target }}
    - name: Package Tarball
      run: |
        tar -czf ${{ matrix.asset_name }}.tar.gz -C target/${{ matrix.target }}/release ${{ matrix.artifact_name }}
    - name: Upload Artifact
      uses: actions/upload-artifact@v4
      with:
        name: ${{ matrix.asset_name }}
        path: ${{ matrix.asset_name }}.tar.gz

  release:
    name: Create GitHub Release
    needs: build
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: actions/download-artifact@v4
      with:
        path: artifacts
    - name: Create Release
      uses: softprops/action-gh-release@v2
      with:
        files: artifacts/*/*.tar.gz
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}