Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ jobs:
- name: Clippy
run: cargo clippy --all-targets -- -D warnings

audit:
name: Security audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install cargo-deny
run: cargo install cargo-deny
- name: Check advisories, licenses, and bans
run: cargo deny check

test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
Expand All @@ -39,13 +50,26 @@ jobs:
run: cargo test

msrv:
name: MSRV check
name: MSRV (build + test)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.85.0
- name: Build
run: cargo build
run: cargo build --all-targets
- name: Test
run: cargo test

bench:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build benchmarks
run: cargo bench --no-run
- name: Record benchmark metadata
run: echo "Benchmarks built successfully (bench results not saved in CI)"

fuzz:
name: Fuzz smoke test (100K)
Expand Down
114 changes: 114 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Release

on:
push:
tags:
- 'v*'

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
archive: tar.gz
- target: x86_64-apple-darwin
os: macos-latest
archive: tar.gz
- target: aarch64-apple-darwin
os: macos-latest
archive: tar.gz
- target: x86_64-pc-windows-msvc
os: windows-latest
archive: zip

steps:
- uses: actions/checkout@v4

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

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

- name: Package (Unix)
if: matrix.archive == 'tar.gz'
shell: bash
run: |
ARCHIVE_DIR="cryptotrace-${{ github.ref_name }}-${{ matrix.target }}"
mkdir -p "$ARCHIVE_DIR"
cp "target/${{ matrix.target }}/release/cryptotrace" "$ARCHIVE_DIR/"
cp "target/${{ matrix.target }}/release/cryptotrace-worker" "$ARCHIVE_DIR/"
cp -r signatures "$ARCHIVE_DIR/"
cp -r calibration_data "$ARCHIVE_DIR/"
cp docs/CONFIGURATION.md "$ARCHIVE_DIR/"
cp CHANGELOG.md "$ARCHIVE_DIR/"
tar czf "$ARCHIVE_DIR.tar.gz" "$ARCHIVE_DIR"

- name: Package (Windows)
if: matrix.archive == 'zip'
shell: pwsh
run: |
$archiveDir = "cryptotrace-$env:GITHUB_REF_NAME-${{ matrix.target }}"
New-Item -ItemType Directory -Path $archiveDir -Force
Copy-Item "target/${{ matrix.target }}/release/cryptotrace.exe" "$archiveDir/"
Copy-Item "target/${{ matrix.target }}/release/cryptotrace-worker.exe" "$archiveDir/"
Copy-Item -Recurse signatures "$archiveDir/"
Copy-Item -Recurse calibration_data "$archiveDir/"
Copy-Item docs/CONFIGURATION.md "$archiveDir/"
Copy-Item CHANGELOG.md "$archiveDir/"
Compress-Archive -Path $archiveDir -DestinationPath "$archiveDir.zip"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cryptotrace-${{ github.ref_name }}-${{ matrix.target }}
path: cryptotrace-${{ github.ref_name }}-${{ matrix.target }}.${{ matrix.archive }}

publish:
name: Publish to crates.io
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish

release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Generate checksums
run: |
cd artifacts
for f in */*.tar.gz */*.zip; do
sha256sum "$f" >> checksums.txt
done

- name: Create release
uses: softprops/action-gh-release@v2
with:
name: CryptoTrace ${{ github.ref_name }}
body_path: CHANGELOG.md
files: artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ version = "0.1.0"
edition = "2024"
description = "Cryptographic Fingerprinting & Data Classification Engine"
license = "Apache-2.0"
homepage = "https://github.com/parv68/CryptoTrace"
repository = "https://github.com/parv68/CryptoTrace"
readme = "README.md"
rust-version = "1.85"
keywords = ["forensics", "cryptography", "detection", "security", "entropy", "encoding"]
categories = ["command-line-utilities", "encoding", "cryptography", "compression"]

[dependencies]
# CLI
Expand All @@ -12,9 +18,6 @@ clap = { version = "4", features = ["derive"] }
# Async runtime
tokio = { version = "1", features = ["full"] }

# HTTP / API
axum = "0.8"

# Serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"
Expand Down
34 changes: 34 additions & 0 deletions Formula/cryptotrace.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
class Cryptotrace < Formula
desc "Cryptographic fingerprinting and data classification engine"
homepage "https://github.com/parv68/CryptoTrace"
version "0.1.0"
license "Apache-2.0"

on_macos do
if Hardware::CPU.arm?
url "https://github.com/parv68/CryptoTrace/releases/download/v0.1.0/cryptotrace-0.1.0-aarch64-apple-darwin.tar.gz"
sha256 "0000000000000000000000000000000000000000000000000000000000000000" # Placeholder
else
url "https://github.com/parv68/CryptoTrace/releases/download/v0.1.0/cryptotrace-0.1.0-x86_64-apple-darwin.tar.gz"
sha256 "0000000000000000000000000000000000000000000000000000000000000000" # Placeholder
end
end

on_linux do
url "https://github.com/parv68/CryptoTrace/releases/download/v0.1.0/cryptotrace-0.1.0-x86_64-unknown-linux-gnu.tar.gz"
sha256 "0000000000000000000000000000000000000000000000000000000000000000" # Placeholder
end

def install
bin.install "cryptotrace"
bin.install "cryptotrace-worker"
prefix.install "signatures"
prefix.install "calibration_data"
prefix.install "docs"
prefix.install "cryptotrace.toml.example"
end

test do
assert_match "CryptoTrace", shell_output("#{bin}/cryptotrace version")
end
end
Loading
Loading