-
Notifications
You must be signed in to change notification settings - Fork 4
226 lines (222 loc) · 8.74 KB
/
ci.yml
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
name: CI
on:
push:
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
pull_request:
branches:
- master
workflow_dispatch:
jobs:
build-windows:
runs-on: windows-latest
if: "startsWith(github.ref, 'refs/tags/') || !contains(github.event.head_commit.message, '[skip build]')"
env:
PLATFORM: x64
WIRESHARK_DIR: ${{ github.workspace }}/wireshark
WIRESHARK_LIB_DIR: C:/wireshark-win64-libs-4.2
WIRESHARK_BUILD_DIR: ${{ github.workspace }}/wireshark/build
WIRESHARK_LIB_FILE_DIR: ${{ github.workspace }}/wireshark/build/run/RelWithDebInfo
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
path: dissector
- name: Checkout Wireshark
uses: actions/checkout@v4
with:
repository: wireshark/wireshark
path: wireshark
ref: wireshark-4.2.0
- name: Choco install Wireshark Deps
run: choco install -y --no-progress cmake winflexbison3 strawberryperl asciidoctorj xsltproc docbook-bundle ninja make mingw
- name: Add msbuild to PATH
uses: microsoft/[email protected]
with:
vs-version: 16.4
- name: Make build dir
run: mkdir build
working-directory: wireshark
- name: Configure Wireshark
run: cmake -A x64 .. -DBUILD_wireshark=OFF
working-directory: wireshark/build
- run: cmake --build . --config RelWithDebInfo --target epan
working-directory: wireshark/build
- name: Configure dissector (Debug)
if: "!startsWith(github.ref, 'refs/tags/') || contains(github.ref, 'beta')"
run: cmake -S . -G Ninja -B build
working-directory: dissector
- name: Configure dissector (Release)
if: "startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'beta')"
run: cmake -DCMAKE_BUILD_TYPE=Release -S . -G Ninja -B build
working-directory: dissector
- name: Build dissector
run: cmake --build build --target MC_Dissector
working-directory: dissector
- name: Configure dissector - No Function Feature (Debug)
if: "!startsWith(github.ref, 'refs/tags/') || contains(github.ref, 'beta')"
run: cmake -S . -G Ninja -B build-no-function -DMC_DISSECTOR_FUNCTION_FEATURE=OFF
working-directory: dissector
- name: Configure dissector - No Function Feature (Release)
if: "startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'beta')"
run: cmake -DCMAKE_BUILD_TYPE=Release -S . -G Ninja -B build-no-function -DMC_DISSECTOR_FUNCTION_FEATURE=OFF
working-directory: dissector
- name: Build dissector - No Function Feature
run: cmake --build build-no-function --target MC_Dissector
working-directory: dissector
- name: Upload dissector
uses: actions/upload-artifact@v3
with:
name: windows
path: dissector/build/mcdissector.dll
- name: Upload dissector (no function)
uses: actions/upload-artifact@v3
with:
name: windows-no-function
path: dissector/build-no-function/mcdissector.dll
build-linux:
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/') || !contains(github.event.head_commit.message, '[skip build]')"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Install Deps
run: sudo apt-get install cmake libglib2.0 libgcrypt-dev libwireshark-dev make clang
- name: Configure dissector (Debug)
if: "!startsWith(github.ref, 'refs/tags/') || contains(github.ref, 'beta')"
run: cmake -S . -B build
- name: Configure dissector (Release)
if: "startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'beta')"
run: cmake -DCMAKE_BUILD_TYPE=Release -S . -B build
- name: Build dissector
run: make -j8
working-directory: build
- name: Configure dissector - No Function (Debug)
if: "!startsWith(github.ref, 'refs/tags/') || contains(github.ref, 'beta')"
run: cmake -S . -B build-no-function -DMC_DISSECTOR_FUNCTION_FEATURE=OFF
- name: Configure dissector - No Function (Release)
if: "startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'beta')"
run: cmake -DCMAKE_BUILD_TYPE=Release -S . -B build-no-function -DMC_DISSECTOR_FUNCTION_FEATURE=OFF
- name: Build dissector - No Function
run: make -j8
working-directory: build-no-function
- name: Upload dissector
uses: actions/upload-artifact@v3
with:
name: linux
path: build/mcdissector.so
- name: Upload dissector (no function)
uses: actions/upload-artifact@v3
with:
name: linux-no-function
path: build-no-function/mcdissector.so
build-encryption-helper:
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/') || !contains(github.event.head_commit.message, '[skip build]')"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 8
distribution: temurin
- name: Chmod Gradlew
run: chmod +x gradlew
working-directory: encryption-helper
- name: Build Encryption Helper
run: ./gradlew shadowJar
working-directory: encryption-helper
- name: Upload Encryption Helper
uses: actions/upload-artifact@v3
with:
name: encryption-helper
path: encryption-helper/build/libs/encryption-helper-1.0-all.jar
publish:
needs: [ build-windows, build-linux, build-encryption-helper ]
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
permissions: write-all
steps:
- name: Download windows artifact
uses: actions/download-artifact@v3
with:
name: windows
path: windows
- name: Download windows artifact (no function)
uses: actions/download-artifact@v3
with:
name: windows-no-function
path: windows-no-function
- name: Download linux artifact
uses: actions/download-artifact@v3
with:
name: linux
path: linux
- name: Download linux artifact (no function)
uses: actions/download-artifact@v3
with:
name: linux-no-function
path: linux-no-function
- name: Download encryption-helper artifact
uses: actions/download-artifact@v3
with:
name: encryption-helper
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: ${{ contains(github.ref, 'beta') }}
- name: Upload mcdissector.dll
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows/mcdissector.dll
asset_name: mcdissector.dll
asset_content_type: application/octet-stream
- name: Upload mcdissector-no-function.dll
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows-no-function/mcdissector.dll
asset_name: mcdissector-no-function.dll
asset_content_type: application/octet-stream
- name: Upload mcdissector.so
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./linux/mcdissector.so
asset_name: mcdissector.so
asset_content_type: application/octet-stream
- name: Upload mcdissector-no-function.so
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./linux-no-function/mcdissector.so
asset_name: mcdissector-no-function.so
asset_content_type: application/octet-stream
- name: Upload encryption-helper
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./encryption-helper-1.0-all.jar
asset_name: encryption-helper.jar
asset_content_type: application/octet-stream