velociraptor_api 0.1.0

API client for Velociraptor (https://github.com/Velocidex/velociraptor)
Documentation
on:
  push:
    tags:
      - "v*"

jobs:
  prep:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Get Version
        id: get_version
        run: |
          version_git=$(echo "$GITHUB_REF" | sed -e 's/refs\/tags\///')
          version_cargo="v$(cargo read-manifest | jq -r '.version')"
          if [ "$version_git" != "$version_cargo" ]; then
              echo "git != cargo: $version_git != $version_cargo" >&2
              exit 1
          fi
          echo "git_version=$version_git" >> $GITHUB_OUTPUT
      - name: Create release
        uses: softprops/action-gh-release@v1

  build_static_musl:
    needs: prep
    runs-on: ubuntu-latest
    container: alpine:3.18
    steps:
      - run: apk add bash curl build-base protobuf-dev
      - uses: actions/checkout@v4
      - uses: Swatinem/rust-cache@v2
      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: stable
      - run: |
          RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --target=x86_64-unknown-linux-musl
          ref=$(echo '${{ github.ref }}' | sed -e s,refs/tags/,, )
          ln target/x86_64-unknown-linux-musl/release/velociraptor-client \
              velociraptor-client-${ref}-x86_64-musl
      - name: Upload Release Asset
        uses: softprops/action-gh-release@v1
        with:
          files: |
            velociraptor-client-*