-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (150 loc) · 5.36 KB
/
macos.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
# GitHub Action workflows to build and test the plug-in on MacOS
#
# Adapted from Wireshark's repository https://gitlab.com/wireshark/wireshark/-/tree/master/.github/workflows
name: Build and test MacOS plug-in
on: [push, pull_request]
env:
WIRESHARK_BRANCH: release-3.6
WIRESHARK_QT_VERSION: 5.15.3
jobs:
standalone:
name: Build and test standalone plugin
runs-on: macos-latest
continue-on-error: true
steps:
- name: Checkout plug-in
uses: actions/checkout@v2
- name: Update brew packages
run: brew update
- name: Install dependencies for a standalone build
run: |
brew install wireshark -v
- name: Build standalone
run: |
mkdir build
cd build
cmake ..
make
make install
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 2.7
- name: Install dependencies for testing
run: |
brew install libdnet libpcap
- name: Install Python packages for testing
run: |
python2 -m pip install --upgrade pip setuptools wheel
python2 -m pip install pysap
- name: Install patched pyshark-legacy version
run: |
git clone https://github.com/martingalloar/pyshark-legacy
python2 -m pip install pyshark-legacy/src
- name: Run tests
run: |
python2 tests/__init__.py
- name: Copy plugin so
run: |
mkdir exe
cp build/sap.so exe/sap-standalone.so
- name: Upload Ubuntu packages
uses: actions/upload-artifact@v2
with:
name: packages
path: exe
intree:
name: Build and test in-tree plugin
runs-on: macos-latest
steps:
- name: Checkout Wireshark
run: |
git init
git remote add -t "${{ env.WIRESHARK_BRANCH }}" -f origin https://gitlab.com/wireshark/wireshark.git
git checkout ${{ env.WIRESHARK_BRANCH }}
- name: Checkout plug-in
uses: actions/checkout@v2
with:
path: plugins/epan/sap
- name: Apply patch
run: |
git apply plugins/epan/sap/wireshark-${{ env.WIRESHARK_BRANCH }}.patch
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Set up Ruby 2.6
uses: actions/[email protected]
with:
ruby-version: '2.6'
- name: Update brew packages
run: brew update
- name: Install dependencies for a in-tree build
run: |
brew install c-ares glib libgcrypt gnutls [email protected] cmake nghttp2 snappy lz4 libxml2 ninja libmaxminddb libsmi spandsp brotli minizip zstd libssh libilbc speexdsp gettext qt5 || true
- name: Install asciidoctor
run: gem install asciidoctor
- name: Build in-tree
run: |
mkdir build
cd build
cmake ..
make sap tshark
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 2.7
- name: Install dependencies for testing
run: |
brew install libdnet libpcap
- name: Install Python packages for testing
run: |
python2 -m pip install --upgrade pip setuptools wheel
python2 -m pip install pysap
- name: Install patched pyshark-legacy version
run: |
git clone https://github.com/martingalloar/pyshark-legacy
python2 -m pip install pyshark-legacy/src
- name: Run tests
run: |
cd plugins/epan/sap
python2 tests/__init__.py
env:
TSHARK_PATH: ${{ github.workspace }}/build/run/Wireshark.app/Contents/MacOS/tshark
- name: Copy plugin so
run: |
mkdir exe
cp build/run/Wireshark.app/Contents/PlugIns/wireshark/3-6/epan/sap.so exe/sap-source.so
- name: Upload MacOS artifacts
uses: actions/upload-artifact@v2
with:
name: packages
path: exe
release:
name: Release
runs-on: macos-latest
needs: intree
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'v') }}
steps:
- name: Download MacOS artifacts
uses: actions/download-artifact@v2
with:
name: packages
path: exe
- name: Create a release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: SAP Plug-in for Wireshark ${{ github.ref }}
draft: true
prerelease: false
- name: Upload release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: exe/sap-source.so
asset_name: sap-${{ github.ref }}-macos-x86-64.so
asset_content_type: application/octet-stream