-
Notifications
You must be signed in to change notification settings - Fork 22
516 lines (434 loc) · 18.6 KB
/
release.yml
File metadata and controls
516 lines (434 loc) · 18.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
env:
APP_NAME: SolidityGuard
APP_VERSION: ${{ github.ref_name }}
jobs:
# ── CLI Package ───────────────────────────────────────────────────────
build-cli:
name: CLI (pip package)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build tools
run: pip install build
- name: Build CLI package
run: |
cd apps/cli
python -m build
- name: Upload CLI dist
uses: actions/upload-artifact@v4
with:
name: solidityguard-cli
path: apps/cli/dist/*
# ── OpenClaw Skill ──────────────────────────────────────────────────
build-skill:
name: OpenClaw Skill
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Package OpenClaw skill
run: |
cd apps/openclaw-skill
# Ensure scripts are bundled
cp ../../.claude/skills/solidity-guard/scripts/solidity_guard.py scripts/
cp ../../.claude/skills/solidity-guard/scripts/report_generator.py scripts/
chmod +x scripts/*.sh
cd ..
tar czf solidityguard-openclaw-skill.tar.gz openclaw-skill/
zip -r solidityguard-openclaw-skill.zip openclaw-skill/
- name: Upload skill tarball
uses: actions/upload-artifact@v4
with:
name: solidityguard-openclaw-skill
path: |
apps/solidityguard-openclaw-skill.tar.gz
apps/solidityguard-openclaw-skill.zip
# ── Desktop: Linux ─────────────────────────────────────────────────
build-linux:
name: Linux (deb + AppImage)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: apps/desktop/src-tauri
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libfuse2
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build scanner binaries (Linux)
run: |
cd apps/desktop/pyinstaller
pip install -r requirements-build.txt
pyinstaller solidityguard-scanner.spec --clean
pyinstaller solidityguard-report-gen.spec --clean
./dist/solidityguard-scanner --help
mkdir -p ../src-tauri/binaries
cp dist/solidityguard-scanner ../src-tauri/binaries/
cp dist/solidityguard-report-gen ../src-tauri/binaries/
- name: Build web frontend
run: |
cd apps/web/frontend
npm ci
npm run build
- name: Build desktop app
run: |
cd apps/desktop
npm ci
npm run tauri:build
- name: Upload deb
uses: actions/upload-artifact@v4
with:
name: solidityguard-linux-deb
path: apps/desktop/src-tauri/target/release/bundle/deb/*.deb
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: solidityguard-linux-appimage
path: apps/desktop/src-tauri/target/release/bundle/appimage/*.AppImage
# ── Desktop: macOS (signed + notarized) ────────────────────────────
build-macos:
name: macOS (dmg, signed)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: apps/desktop/src-tauri
- name: Import Apple certificate
if: env.APPLE_CERTIFICATE != ''
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
run: |
# Create temporary keychain
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
KEYCHAIN_PASSWORD=$(openssl rand -hex 32)
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
# Import certificate
CERT_PATH=$RUNNER_TEMP/certificate.p12
echo "$APPLE_CERTIFICATE" | base64 --decode > "$CERT_PATH"
security import "$CERT_PATH" -P "$APPLE_CERTIFICATE_PASSWORD" \
-A -t cert -f pkcs12 -k "$KEYCHAIN_PATH"
security set-key-partition-list -S apple-tool:,apple: \
-k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security list-keychain -d user -s "$KEYCHAIN_PATH"
# Clean up certificate file
rm -f "$CERT_PATH"
- name: Install DMG tools
run: brew install create-dmg
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build scanner binaries (macOS)
env:
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
run: |
cd apps/desktop/pyinstaller
pip install -r requirements-build.txt
pyinstaller solidityguard-scanner.spec --clean
pyinstaller solidityguard-report-gen.spec --clean
./dist/solidityguard-scanner --help
# Sign binaries so Apple notarization accepts them inside the .app
if [ -n "$APPLE_SIGNING_IDENTITY" ]; then
echo "Signing PyInstaller binaries with Developer ID..."
codesign --force --options runtime --timestamp \
--sign "$APPLE_SIGNING_IDENTITY" dist/solidityguard-scanner
codesign --force --options runtime --timestamp \
--sign "$APPLE_SIGNING_IDENTITY" dist/solidityguard-report-gen
echo "Verifying signatures..."
codesign -dvv dist/solidityguard-scanner
codesign -dvv dist/solidityguard-report-gen
else
echo "No signing identity — skipping binary signing"
fi
mkdir -p ../src-tauri/binaries
cp dist/solidityguard-scanner ../src-tauri/binaries/
cp dist/solidityguard-report-gen ../src-tauri/binaries/
- name: Build web frontend
run: |
cd apps/web/frontend
npm ci
npm run build
- name: Build desktop app (with signing)
id: tauri_build
continue-on-error: true
env:
# Apple code signing — Tauri reads these automatically
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
# Apple notarization
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
cd apps/desktop
npm ci
npm run tauri:build
- name: Create DMG fallback
if: steps.tauri_build.outcome == 'failure'
env:
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
run: |
APP_PATH="apps/desktop/src-tauri/target/release/bundle/macos/SolidityGuard.app"
DMG_DIR="apps/desktop/src-tauri/target/release/bundle/dmg"
mkdir -p "$DMG_DIR"
if [ -d "$APP_PATH" ]; then
echo "Creating DMG with create-dmg..."
create-dmg \
--volname "SolidityGuard" \
--window-pos 200 120 \
--window-size 600 400 \
--icon-size 100 \
--icon "SolidityGuard.app" 150 190 \
--app-drop-link 450 190 \
"$DMG_DIR/SolidityGuard_${APP_VERSION#v}_aarch64.dmg" \
"$APP_PATH" || \
hdiutil create -volname "SolidityGuard" -srcfolder "$APP_PATH" \
-ov -format UDZO "$DMG_DIR/SolidityGuard_${APP_VERSION#v}_aarch64.dmg"
# Sign the DMG
if [ -n "$APPLE_SIGNING_IDENTITY" ]; then
codesign --force --sign "$APPLE_SIGNING_IDENTITY" "$DMG_DIR"/*.dmg || true
fi
else
echo "::error::No .app bundle found — build failed before bundling"
exit 1
fi
- name: Clean up keychain
if: always()
run: |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
if [ -f "$KEYCHAIN_PATH" ]; then
security delete-keychain "$KEYCHAIN_PATH" 2>/dev/null || true
fi
- name: Upload dmg
if: always()
uses: actions/upload-artifact@v4
with:
name: solidityguard-macos-dmg
path: apps/desktop/src-tauri/target/release/bundle/dmg/*.dmg
# ── Desktop: Windows (signed) ──────────────────────────────────────
build-windows:
name: Windows (msi + exe, signed)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: apps/desktop/src-tauri
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build scanner binaries (Windows)
shell: pwsh
run: |
cd apps/desktop/pyinstaller
pip install -r requirements-build.txt
pyinstaller solidityguard-scanner.spec --clean
pyinstaller solidityguard-report-gen.spec --clean
./dist/solidityguard-scanner.exe --help
New-Item -ItemType Directory -Force -Path ../src-tauri/binaries
Copy-Item dist/solidityguard-scanner.exe ../src-tauri/binaries/
Copy-Item dist/solidityguard-report-gen.exe ../src-tauri/binaries/
- name: Build web frontend
run: |
cd apps/web/frontend
npm ci
npm run build
- name: Build desktop app
env:
# Windows code signing — Tauri reads these automatically
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: |
cd apps/desktop
npm ci
npm run tauri:build
- name: Sign Windows binaries
if: env.WINDOWS_CERTIFICATE != ''
env:
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
shell: pwsh
run: |
$cert = [System.Convert]::FromBase64String($env:WINDOWS_CERTIFICATE)
$certPath = Join-Path $env:RUNNER_TEMP "certificate.pfx"
[System.IO.File]::WriteAllBytes($certPath, $cert)
# Sign MSI
Get-ChildItem "apps/desktop/src-tauri/target/release/bundle/msi/*.msi" | ForEach-Object {
& signtool sign /f $certPath /p $env:WINDOWS_CERTIFICATE_PASSWORD `
/t http://timestamp.digicert.com /fd SHA256 $_.FullName
}
# Sign EXE
Get-ChildItem "apps/desktop/src-tauri/target/release/bundle/nsis/*.exe" | ForEach-Object {
& signtool sign /f $certPath /p $env:WINDOWS_CERTIFICATE_PASSWORD `
/t http://timestamp.digicert.com /fd SHA256 $_.FullName
}
Remove-Item $certPath -Force
- name: Upload msi
uses: actions/upload-artifact@v4
with:
name: solidityguard-windows-msi
path: apps/desktop/src-tauri/target/release/bundle/msi/*.msi
- name: Upload nsis
uses: actions/upload-artifact@v4
with:
name: solidityguard-windows-nsis
path: apps/desktop/src-tauri/target/release/bundle/nsis/*.exe
# ── Create Release ─────────────────────────────────────────────────
release:
name: Create Release
needs: [build-cli, build-skill, build-linux, build-macos, build-windows]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List artifacts
run: find artifacts -type f | sort
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: "${{ env.APP_NAME }} ${{ github.ref_name }}"
draft: false
prerelease: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') || contains(github.ref_name, 'rc') }}
body: |
## SolidityGuard ${{ github.ref_name }}
Smart contract security audit tool with **104 vulnerability patterns**, **9 analysis tools**, **multi-agent team architecture**, and **100% detection rate** on 85/85 CTF benchmark challenges (DeFiVulnLabs + Paradigm CTF + R3CTF 2025 + HTB Cyber Apocalypse 2025).
---
### Components
| Component | Description |
|-----------|-------------|
| **Desktop App** | Native desktop application (Tauri v2) for Windows, macOS, and Linux |
| **Web App** | React frontend + FastAPI backend — deployed at [solidityguard.org](https://solidityguard.org) |
| **CLI** | Python CLI tool for terminal-based auditing (download `.whl` from release assets) |
| **OpenClaw Skill** | AI agent skill for [OpenClaw](https://openclaw.ai) — install via ClawHub |
---
### Desktop Downloads
| Platform | File | Description |
|----------|------|-------------|
| **Linux** | `.deb` | Debian / Ubuntu package (apt install) |
| **Linux** | `.AppImage` | Portable — no installation needed, just run |
| **macOS** | `.dmg` | Drag-and-drop disk image installer |
| **Windows** | `.msi` | Windows Installer (MSI) |
| **Windows** | `.exe` | NSIS installer with auto-updater |
### CLI Install
```bash
# Download .whl from release assets, then:
pip install solidityguard-*.whl
solidityguard audit ./contracts
```
Or install from source:
```bash
git clone https://github.com/alt-research/SolidityGuard.git
cd SolidityGuard/apps/cli && pip install -e .
```
### OpenClaw Skill Install
```bash
# Via ClawHub
npx clawhub@latest install solidityguard
# Manual — download and extract to skills directory
tar xzf solidityguard-openclaw-skill.tar.gz -C ~/.openclaw/skills/
```
---
### What's Included
- **104 vulnerability patterns** (ETH-001 to ETH-104) covering reentrancy, access control, DeFi, proxy, oracle, transient storage, EIP-7702, ERC-4337, and more
- **50+ pattern detectors** with 100% benchmark detection rate
- **9-tool integration** — Slither, Aderyn, Mythril, Foundry, Echidna, Medusa, Halmos, Certora, EVMBench
- **7-phase deep audit** — scan, verify, parallel agents, exploit PoC, dynamic verification, fuzz, report
- **Multi-agent team architecture** — 9 specialized sub-agents working in parallel
- **Professional reports** — OpenZeppelin / Trail of Bits style (Markdown + PDF)
- **Real-time progress** — WebSocket streaming for live audit updates
- **EVMBench integration** — detect, patch, and exploit modes for benchmark evaluation
- **OWASP 2025 aligned** — covers all Smart Contract Top 10 categories
### Benchmarks
| Benchmark | Result |
|-----------|--------|
| DeFiVulnLabs | 56/56 contracts (100%) |
| Paradigm CTF 2021 | 10/10 static challenges (100%) |
| Paradigm CTF 2022 | 7/7 static challenges (100%) |
| Paradigm CTF 2023 | 7/7 static challenges (100%) |
| R3CTF 2025 | 2/2 challenges (100%) |
| HTB Cyber Apocalypse 2025 | 3/3 challenges (100%) |
| **Combined** | **85/85 (100%)** |
| EVMBench | 120/120 vulns across 40 audits (100%) |
### System Requirements
- **Desktop**: Windows 10+, macOS 12+, Ubuntu 22.04+ / Debian 12+
- **CLI**: Python 3.10+
- **Optional tools**: Slither, Aderyn, Mythril, Foundry (for full multi-tool scanning)
### Quick Start
**Desktop:**
1. Download the installer for your platform
2. Install and launch SolidityGuard
3. Sign in with Google
4. Upload `.sol` / `.vy` files or select a local contracts directory
5. Configure scan mode and tools, then start the audit
**CLI:**
```bash
# Install from release .whl or from source
pip install solidityguard-*.whl
solidityguard audit ./contracts --mode full
solidityguard report --input findings.json --output report.md
```
**OpenClaw:**
Just ask your AI agent: "Audit my contracts for security vulnerabilities"
---
*Built with [Tauri v2](https://v2.tauri.app) + React + TypeScript + FastAPI + Python*
files: |
artifacts/**/*.deb
artifacts/**/*.AppImage
artifacts/**/*.dmg
artifacts/**/*.msi
artifacts/**/*.exe
artifacts/**/*.tar.gz
artifacts/**/*.zip
artifacts/**/*.whl