-
-
Notifications
You must be signed in to change notification settings - Fork 0
209 lines (183 loc) · 6.61 KB
/
Copy pathrelease.yml
File metadata and controls
209 lines (183 loc) · 6.61 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
name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-*'
env:
CARGO_TERM_COLOR: always
permissions:
contents: write
jobs:
# Build binaries
build:
name: Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
artifact: spectre-linux-x86_64
- target: x86_64-unknown-linux-musl
os: ubuntu-22.04
artifact: spectre-linux-x86_64-musl
features: vendored-openssl
- target: aarch64-unknown-linux-gnu
os: ubuntu-22.04
artifact: spectre-linux-aarch64
cross: true
features: vendored-openssl
- target: x86_64-apple-darwin
os: macos-15-intel
artifact: spectre-macos-x86_64
- target: aarch64-apple-darwin
os: macos-14
artifact: spectre-macos-aarch64
- target: x86_64-pc-windows-msvc
os: windows-2022
artifact: spectre-windows-x86_64
ext: .exe
steps:
- uses: actions/checkout@v6
- name: Initialize submodules
run: git submodule update --init --depth 1 components/prtip components/wraith-protocol components/cyberchef-mcp
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Install Linux dependencies
if: runner.os == 'Linux' && !matrix.cross
run: |
sudo apt-get update
sudo apt-get install -y libpcap-dev musl-tools
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: brew install libpcap
- name: Install Windows dependencies
if: runner.os == 'Windows'
shell: pwsh
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=${{ github.workspace }}\npcap-sdk\Lib\x64" >> $env:GITHUB_ENV
- name: Build (native)
if: '!matrix.cross'
run: cargo build --release --target ${{ matrix.target }} -p spectre-cli ${{ matrix.features && format('--features {0}', matrix.features) || '' }}
- name: Build (cross)
if: matrix.cross
run: cross build --release --target ${{ matrix.target }} -p spectre-cli ${{ matrix.features && format('--features {0}', matrix.features) || '' }}
- name: Package (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/spectre dist/
cp README.md CHANGELOG.md dist/
if [ -f LICENSE ]; then cp LICENSE dist/; fi
cd dist && tar -czvf ../${{ matrix.artifact }}.tar.gz *
- name: Package (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path dist
Copy-Item "target/${{ matrix.target }}/release/spectre${{ matrix.ext }}" dist/
Copy-Item README.md dist/
Copy-Item CHANGELOG.md dist/
if (Test-Path LICENSE) { Copy-Item LICENSE dist/ }
Compress-Archive -Path dist/* -DestinationPath "${{ matrix.artifact }}.zip"
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: |
${{ matrix.artifact }}.tar.gz
${{ matrix.artifact }}.zip
fail_on_unmatched_files: false
# Build GUI installers
build-gui:
name: Build GUI Installers (${{ matrix.platform.name }})
strategy:
fail-fast: false
matrix:
platform:
- name: Linux x86_64
os: ubuntu-22.04
rust: stable
target: x86_64-unknown-linux-gnu
- name: macOS x86_64
os: macos-15-intel
rust: stable
target: x86_64-apple-darwin
- name: macOS ARM64
os: macos-14
rust: stable
target: aarch64-apple-darwin
- name: Windows x86_64
os: windows-2022
rust: stable
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v6
with:
submodules: false
- name: Initialize submodules
run: git submodule update --init --depth 1 components/prtip components/wraith-protocol components/cyberchef-mcp
- name: Install system dependencies (Linux)
if: matrix.platform.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libpcap-dev
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install libpcap
- name: Install system dependencies (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
# Download Npcap SDK for ProRT-IP
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=${{ github.workspace }}\npcap-sdk\Lib\x64" >> $env:GITHUB_ENV
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.platform.rust }}
targets: ${{ matrix.platform.target }}
- uses: Swatinem/rust-cache@v2
with:
workspaces: "crates/spectre-gui -> target"
key: ${{ matrix.platform.target }}
prefix-key: "v2"
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
cache-dependency-path: crates/spectre-gui/frontend/pnpm-lock.yaml
- name: Install GUI dependencies
working-directory: crates/spectre-gui
run: pnpm install --ignore-workspace
- name: Install frontend dependencies
working-directory: crates/spectre-gui/frontend
run: pnpm install --frozen-lockfile
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: crates/spectre-gui
args: --target ${{ matrix.platform.target }}