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
name: Build Zond
on:
release:
types:
push:
branches:
paths:
- 'core/**'
- 'engine/**'
- 'cli/**'
- 'plugins/**'
- 'protocols/**'
- 'tests/**'
- 'scripts/**'
- 'docker/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/build.yml'
pull_request:
branches:
paths:
- 'core/**'
- 'engine/**'
- 'cli/**'
- 'plugins/**'
- 'protocols/**'
- 'tests/**'
- 'scripts/**'
- 'docker/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/build.yml'
permissions:
contents: write
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
- name: Download and Configure Npcap SDK (Windows)
if: matrix.os == 'windows-latest'
run: |
Invoke-WebRequest -Uri "https://npcap.com/dist/npcap-sdk-1.13.zip" -OutFile "npcap-sdk.zip"
Expand-Archive -Path "npcap-sdk.zip" -DestinationPath "npcap-sdk"
echo "LIB=$env:GITHUB_WORKSPACE\npcap-sdk\Lib\x64;$env:LIB" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Run Tests (macOS & Linux)
if: matrix.os != 'windows-latest'
run: cargo test --workspace
- name: Verify Compilation (Windows)
if: matrix.os == 'windows-latest'
run: cargo check --workspace
- name: Build Release Binary
if: github.event_name == 'release'
run: cargo build --release
- name: Package MacOS Binary
if: matrix.os == 'macos-latest' && github.event_name == 'release'
run: |
cd target/release
zip zond-macos.zip zond
- name: Package Linux Binary
if: matrix.os == 'ubuntu-latest' && github.event_name == 'release'
run: |
cd target/release
tar -czf zond-linux.tar.gz zond
- name: Build Windows Installer (Inno Setup)
if: matrix.os == 'windows-latest' && github.event_name == 'release'
run: iscc packaging/windows/zond_installer.iss
- name: Build Debian Package
if: matrix.os == 'ubuntu-latest' && github.event_name == 'release'
run: |
cargo install cargo-deb
cargo deb -p zond-cli
# --- RELEASE STEP (Only runs on actual Release events) ---
- name: Upload Release Assets
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: |
target/release/zond-macos.zip
target/release/zond-linux.tar.gz
target/release/Zond_Setup.exe
target/debian/*.deb
test-docker:
name: Docker Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Docker Integration Tests
run: |
chmod +x scripts/run_integration_docker.sh
./scripts/run_integration_docker.sh