-
Notifications
You must be signed in to change notification settings - Fork 9
172 lines (149 loc) · 5.79 KB
/
release.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
name: Release
on:
workflow_dispatch:
inputs:
tag:
description: The tag to be released, e.g. v0.1.0
required: true
release_body:
description: Description of the release
required: false
jobs:
create-release:
name: Create release
runs-on: ubuntu-latest
steps:
- name: Create GitHub release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.tag }}
release_name: ${{ github.event.inputs.tag }}
body: ${{ github.event.inputs.release_body }}
draft: true
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
build:
name: Build
runs-on: ${{ matrix.os }}
needs: create-release
strategy:
matrix:
# macos-14 is ARM64, macos-13 is x86-64
os: [ubuntu-latest, macos-14, macos-13, windows-latest, ubuntu_arm64]
wireshark_version: [wireshark-4.2.6, wireshark-4.4.2]
include:
# Ubuntu 22.04 Wireshark package version
- os: ubuntu-latest
wireshark_version: wireshark-3.6.2
- os: ubuntu_arm64
wireshark_version: wireshark-3.6.2
# Ubuntu 24.04 Wireshark package version
- os: ubuntu-latest
wireshark_version: wireshark-4.2.2
- os: ubuntu_arm64
wireshark_version: wireshark-4.2.2
steps:
- name: Disable auto CRLF (Windows)
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf false
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag }}
- name: Clone Wireshark
run: git clone --depth 1 --branch ${{ matrix.wireshark_version }} https://github.com/wireshark/wireshark
# Python 3.12 introduced changes that break builds of older Wireshark versions
- name: Install Python 3.11 (Wireshark 3.6.2)
if: matrix.wireshark_version == 'wireshark-3.6.2'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Add Python 3.11 to cmake options (Wireshark 3.6.2)
if: matrix.wireshark_version == 'wireshark-3.6.2'
run: echo "TRACEESHARK_CMAKE_OPTIONS=-DPython3_EXECUTABLE=$(which python3.11)" >> $GITHUB_ENV
# Wireshark has compilation warnings on Wireshark 3.6.2 on Ubuntu
- name: Disable WERROR (Ubuntu, Wireshark 3.6.2)
if: (matrix.os == 'ubuntu_arm64' || matrix.os == 'ubuntu-latest') && matrix.wireshark_version == 'wireshark-3.6.2'
run: echo "WERROR=n" >> $GITHUB_ENV
- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu_arm64'
run: |
sudo apt update
sudo apt install -y ninja-build ccache
sudo wireshark/tools/debian-setup.sh
- name: Install dependencies (Macos)
if: matrix.os == 'macos-14' || matrix.os == 'macos-13'
run: wireshark/tools/macos-setup-brew.sh
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: choco install -y winflexbison3
- name: Install Qt (Windows)
if: matrix.os == 'windows-latest'
uses: jurplel/install-qt-action@v4
with:
version: 6.5
modules: qt5compat
- name: Add msbuild to PATH (Windows)
if: matrix.os == 'windows-latest'
uses: microsoft/setup-msbuild@v2
- name: Install Wireshark headers (Unix)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu_arm64' || matrix.os == 'macos-14' || matrix.os == 'macos-13'
uses: ./.github/actions/install-wireshark-headers-unix
- name: Install Wireshark headers (Windows)
if: matrix.os == 'windows-latest'
uses: ./.github/actions/install-wireshark-headers-windows
- name: Build Traceeshark (Unix)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu_arm64' || matrix.os == 'macos-14' || matrix.os == 'macos-13'
run: |
if [ -z $WERROR ]; then
export WERROR=y
fi
make cmake
make
- name: Build Traceeshark (Windows)
if: matrix.os == 'windows-latest'
run: |
set WIRESHARK_BASE_DIR=%CD%
set WIRESHARK_QT6_PREFIX_PATH=$QT_ROOT_DIR
set WERROR=y
call scripts\cmake.bat
call scripts\build.bat
shell: cmd
- name: Load Plugins Test (Unix)
if: (matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu_arm64' || matrix.os == 'macos-14' || matrix.os == 'macos-13')
run: |
make install
.github/load_plugins.py
- name: Load Plugins Test (Windows)
if: matrix.os == 'windows-latest'
run: |
call scripts\install.bat
python .github/load_plugins.py
shell: cmd
- name: Create distribution archive (Unix)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu_arm64' || matrix.os == 'macos-14' || matrix.os == 'macos-13'
run: |
make dist
DIST_PATH=$(ls dist/*.zip | head -n 1)
DIST_NAME=$(basename $DIST_PATH)
echo "dist_archive=$DIST_NAME" >> $GITHUB_ENV
- name: Create distribution archive (Windows)
if: matrix.os == 'windows-latest'
run: |
& .\scripts\dist.bat
$DIST_PATH = Get-ChildItem -Path "dist/*.zip" | Select-Object -First 1
$DIST_NAME = $DIST_PATH.Name
echo "dist_archive=$DIST_NAME" >> $env:GITHUB_ENV
shell: powershell
- name: Upload distribution archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: dist/${{ env.dist_archive }}
asset_name: ${{ env.dist_archive }}
asset_content_type: application/zip