Skip to content

Commit d375b31

Browse files
committed
fixes
1 parent 4d6053c commit d375b31

24 files changed

Lines changed: 413 additions & 456 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ on: [push, pull_request]
44

55
jobs:
66
test:
7-
runs-on: ubuntu-latest
8-
steps:
9-
- uses: actions/checkout@v3
10-
- uses: actions-rs/toolchain@v1
11-
with:
12-
toolchain: stable
13-
- run: cargo build --release
14-
- run: cargo test
15-
16-
build-cross:
177
runs-on: ${{ matrix.os }}
188
strategy:
199
matrix:
@@ -24,3 +14,4 @@ jobs:
2414
with:
2515
toolchain: stable
2616
- run: cargo build --release
17+
- run: cargo test

.github/workflows/release.yml

Lines changed: 83 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,79 +3,124 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- "v*"
7+
8+
permissions:
9+
contents: write
710

811
jobs:
912
build:
1013
name: Build ${{ matrix.target }}
1114
runs-on: ${{ matrix.os }}
15+
1216
strategy:
17+
fail-fast: false
1318
matrix:
1419
include:
20+
# ---------------- Linux x86_64 ----------------
1521
- os: ubuntu-latest
1622
target: x86_64-unknown-linux-gnu
17-
artifact_name: polymorph
18-
asset_name: polymorph-linux-x64
23+
artifact: polymorph
24+
asset: polymorph-linux-x64.tar.gz
25+
26+
# ---------------- Linux ARM64 ----------------
1927
- os: ubuntu-latest
2028
target: aarch64-unknown-linux-gnu
21-
artifact_name: polymorph
22-
asset_name: polymorph-linux-arm64
29+
artifact: polymorph
30+
asset: polymorph-linux-arm64.tar.gz
31+
use_cross: true
32+
33+
# ---------------- macOS x86_64 ----------------
2334
- os: macos-latest
2435
target: x86_64-apple-darwin
25-
artifact_name: polymorph
26-
asset_name: polymorph-macos-x64
36+
artifact: polymorph
37+
asset: polymorph-macos-x64.tar.gz
38+
39+
# ---------------- macOS ARM64 ----------------
2740
- os: macos-latest
2841
target: aarch64-apple-darwin
29-
artifact_name: polymorph
30-
asset_name: polymorph-macos-arm64
42+
artifact: polymorph
43+
asset: polymorph-macos-arm64.tar.gz
44+
45+
# ---------------- Windows x86_64 ----------------
3146
- os: windows-latest
3247
target: x86_64-pc-windows-msvc
33-
artifact_name: polymorph.exe
34-
asset_name: polymorph-windows-x64.exe
48+
artifact: polymorph.exe
49+
asset: polymorph-windows-x64.zip
3550

3651
steps:
37-
- uses: actions/checkout@v3
38-
39-
- uses: actions-rs/toolchain@v1
52+
- uses: actions/checkout@v4
53+
54+
- name: Install Rust toolchain
55+
uses: dtolnay/rust-toolchain@stable
4056
with:
41-
toolchain: stable
42-
target: ${{ matrix.target }}
43-
override: true
44-
45-
- name: Install cross-compilation tools
57+
targets: ${{ matrix.target }}
58+
59+
# ---------- Linux ARM64 dependencies ----------
60+
- name: Install aarch64 binutils
4661
if: matrix.target == 'aarch64-unknown-linux-gnu'
47-
run: |
48-
sudo apt-get update
49-
sudo apt-get install -y gcc-aarch64-linux-gnu
50-
51-
- name: Build
62+
run: sudo apt-get update && sudo apt-get install -y binutils-aarch64-linux-gnu
63+
64+
# ---------- Install cross ----------
65+
- name: Install cross
66+
if: matrix.use_cross == true
67+
run: cargo install cross --git https://github.com/cross-rs/cross
68+
69+
# ---------- Build ----------
70+
- name: Build (cross)
71+
if: matrix.use_cross == true
72+
run: cross build --release --target ${{ matrix.target }}
73+
74+
- name: Build (native)
75+
if: matrix.use_cross != true
5276
run: cargo build --release --target ${{ matrix.target }}
53-
54-
- name: Strip binary (Linux/macOS)
77+
78+
# ---------- Strip (Linux only, correct tool) ----------
79+
- name: Strip Linux x86_64
80+
if: matrix.target == 'x86_64-unknown-linux-gnu'
81+
run: strip target/${{ matrix.target }}/release/${{ matrix.artifact }}
82+
83+
- name: Strip Linux ARM64
84+
if: matrix.target == 'aarch64-unknown-linux-gnu'
85+
run: aarch64-linux-gnu-strip target/${{ matrix.target }}/release/${{ matrix.artifact }}
86+
87+
# ---------- Package ----------
88+
- name: Package (Unix)
5589
if: matrix.os != 'windows-latest'
56-
run: strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
57-
58-
- name: Upload binary
90+
run: |
91+
cd target/${{ matrix.target }}/release
92+
tar czf ../../../${{ matrix.asset }} ${{ matrix.artifact }}
93+
94+
- name: Package (Windows)
95+
if: matrix.os == 'windows-latest'
96+
run: |
97+
mkdir dist
98+
copy target\${{ matrix.target }}\release\${{ matrix.artifact }} dist\
99+
powershell Compress-Archive dist\* ${{ matrix.asset }}
100+
101+
# ---------- Upload ----------
102+
- name: Upload artifact
59103
uses: actions/upload-artifact@v4
60104
with:
61-
name: ${{ matrix.asset_name }}
62-
path: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
105+
name: ${{ matrix.asset }}
106+
path: ${{ matrix.asset }}
63107

64108
release:
65109
needs: build
66110
runs-on: ubuntu-latest
111+
67112
steps:
68-
- uses: actions/checkout@v3
69-
70-
- name: Download all artifacts
113+
- uses: actions/checkout@v4
114+
115+
- name: Download artifacts
71116
uses: actions/download-artifact@v4
72117
with:
73-
path: artifacts
74-
75-
- name: Create Release
118+
path: dist
119+
120+
- name: Create GitHub Release
76121
uses: softprops/action-gh-release@v1
77122
with:
78-
files: artifacts/**/*
123+
files: dist/**/*
79124
generate_release_notes: true
80125
env:
81126
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ Cargo.lock
33
*.swp
44
.DS_Store
55
test_samples/
6+
tag-sync.sh

CHANGELOG.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
# Changelog
22

33
## [1.1.0] - 2026-01-18
4-
5-
### Added
6-
- APE polyglot detection
7-
- Zig malware detection
8-
- WASM cryptominer detection
4+
- APE, Zig, WASM detection
95
- 19 YARA rules
10-
- Cross-platform support
11-
12-
### Features
13-
- Fast scanning (~50ms per 10MB)
14-
- JSON output
15-
- Risk scoring
16-
- Verbose mode
6+
- Fast scanning

CONTRIBUTING.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
# Contributing
22

3-
We welcome contributions!
4-
5-
## Getting Started
6-
73
1. Fork the repo
8-
2. Create a feature branch
9-
3. Make your changes
10-
4. Add tests
11-
5. Submit a pull request
12-
13-
## Code Style
14-
15-
- Run `cargo fmt`
16-
- Run `cargo clippy`
17-
- Add documentation
4+
2. Create feature branch
5+
3. Add tests
6+
4. Submit PR

Cargo.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,43 @@ license = "MIT"
1313
keywords = ["security", "malware", "polyglot", "detection", "wasm"]
1414
categories = ["command-line-utilities", "development-tools"]
1515

16+
# ---------------- Core dependencies ----------------
1617
[dependencies]
1718
serde = { version = "1.0", features = ["derive"] }
1819
serde_json = "1.0"
1920

21+
# ---------------- Dev / test only ----------------
2022
[dev-dependencies]
2123
tempfile = "3.8"
24+
criterion = "0.5"
2225

26+
# ---------------- Release profile ----------------
2327
[profile.release]
2428
opt-level = 3
2529
lto = true
2630
codegen-units = 1
2731
strip = true
2832
panic = "abort"
2933

34+
# ---------------- Binary ----------------
3035
[[bin]]
3136
name = "polymorph"
3237
path = "src/main.rs"
38+
39+
# ---------------- Benchmarks ----------------
40+
[[bench]]
41+
name = "benchmark"
42+
harness = false
43+
44+
# ---------------- Examples ----------------
45+
[[example]]
46+
name = "basic_scan"
47+
path = "examples/basic_scan.rs"
48+
49+
[[example]]
50+
name = "batch_scan"
51+
path = "examples/batch_scan.rs"
52+
53+
[[example]]
54+
name = "json_output"
55+
path = "examples/json_output.rs"

0 commit comments

Comments
 (0)