-
Notifications
You must be signed in to change notification settings - Fork 4
149 lines (145 loc) · 5.1 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
name: CI
on:
push:
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
- 'README.MD'
- 'README-*.MD'
- 'LICENSE'
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.6
- 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/setup-msbuild@v2
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: Upload dissector
uses: actions/upload-artifact@v4
with:
name: windows
path: dissector/build/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 Depsc
run: |
sudo add-apt-repository ppa:wireshark-dev/stable
sudo apt-get update & sudo apt-get install cmake libwireshark-dev libcjson-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: Upload dissector
uses: actions/upload-artifact@v4
with:
name: linux
path: build/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@v4
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@v4
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@v4
with:
name: windows
path: windows
- name: Download linux artifact
uses: actions/download-artifact@v4
with:
name: linux
path: linux
- name: Download encryption-helper artifact
uses: actions/download-artifact@v4
with:
name: encryption-helper
- id: process-name
env:
REF: ${{ github.ref }}
run: echo ::set-output name=NAME::${REF##*/}
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ steps.process-name.outputs.NAME }}
prerelease: ${{ contains(github.ref, 'beta') }}
files: |
windows/mcdissector.dll
linux/mcdissector.so
encryption-helper-1.0-all.jar