-
Notifications
You must be signed in to change notification settings - Fork 546
387 lines (375 loc) · 13.3 KB
/
build.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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
name: Build
on: [push, pull_request]
jobs:
appimage:
name: AppImage
runs-on: ubuntu-latest
steps:
- name: Install base dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
libopengl0 \
libegl1
- name: Install conda dependencies
id: setup-micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-name: gqrx
create-args: >-
c-compiler
cxx-compiler
cmake
make
pkg-config
gnuradio-core
gnuradio-osmosdr
libboost-headers
mesa-libgl-devel-cos6-x86_64
pybind11
pulseaudio
qt6-gtk-platformtheme
qt6-main
soapysdr-module-lms7
soapysdr-module-plutosdr
soapysdr-module-remote
volk
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure
shell: bash -el {0}
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX ..
- name: Compile
shell: bash -el {0}
working-directory: build
run: |
make -j4
make install
- name: Build AppImage
shell: bash -el {0}
env:
APPIMAGE_EXTRACT_AND_RUN: "1"
PREFIX: ${{ steps.setup-micromamba.outputs.environment-path }}
run: ./appimage.sh
- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: gqrx-appimage-${{ github.run_id }}
path: Gqrx-*.AppImage
macos:
name: MacOS
strategy:
matrix:
arch: [x86_64, arm64]
# NOTE: in the free tier, `macos-13` is x86_64 only, while `macos-14` is arm64 only.
# when we increase the baseline to 14 eventually, we will be losing x86_64 support,
# so hopefully all of the macs will be arm64 by then.
# see https://github.com/actions/runner-images/issues/9741
runs-on: ${{ matrix.arch == 'x86_64' && 'macos-13' || 'macos-14' }}
steps:
- name: Check for Secret availability
id: secret-check
run: |
if [ "${{ secrets.BUILD_CERTIFICATE_BASE64 }}" != '' ]; then
echo "available=true" >> $GITHUB_OUTPUT;
else
echo "available=false" >> $GITHUB_OUTPUT;
fi
- name: Install dependencies
run: |
uname -a
# for https://github.com/actions/runner-images/issues/9272
sudo chown -R runner:admin /usr/local/
brew update
brew install --HEAD librtlsdr
brew install airspy airspyhf boost dylibbundler gnuradio hackrf libbladerf libserialport portaudio pybind11 six soapyremote uhd qt@6 || true
cd /tmp
git clone https://github.com/analogdevicesinc/libiio.git
cd libiio
git checkout v0.23
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make install
cd /tmp
git clone https://github.com/analogdevicesinc/libad9361-iio.git
cd libad9361-iio
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make install
cd /tmp
git clone https://github.com/pothosware/SoapyPlutoSDR.git
cd SoapyPlutoSDR
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make install
cd /tmp
sudo cp /Library/Frameworks/iio.framework/iio /usr/local/lib/libiio.dylib
sudo install_name_tool -id "/usr/local/lib/libiio.dylib" /usr/local/lib/libiio.dylib
sudo cp /Library/Frameworks/ad9361.framework/ad9361 /usr/local/lib/libad9361.dylib
sudo install_name_tool -id "/usr/local/lib/libad9361.dylib" /usr/local/lib/libad9361.dylib
sudo install_name_tool -delete_rpath /Library/Frameworks /usr/local/lib/libad9361.dylib
sudo install_name_tool -change @rpath/iio.framework/Versions/0.23/iio /usr/local/lib/libiio.dylib /usr/local/lib/libad9361.dylib
sudo install_name_tool -change @rpath/iio.framework/Versions/0.23/iio /usr/local/lib/libiio.dylib /usr/local/lib/SoapySDR/modules0.*/libPlutoSDRSupport.so
sudo install_name_tool -change @rpath/ad9361.framework/Versions/0.2/ad9361 /usr/local/lib/libad9361.dylib /usr/local/lib/SoapySDR/modules0.*/libPlutoSDRSupport.so
cd /tmp
git clone https://gitea.osmocom.org/sdr/gr-iqbal.git
cd gr-iqbal
git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make install
cd /tmp
git clone https://gitea.osmocom.org/sdr/gr-osmosdr.git
cd gr-osmosdr
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-Wno-register ..
LIBRARY_PATH=/usr/local/opt/icu4c/lib make -j4
sudo make install
- name: Install Apple certificate
if: ${{ steps.secret-check.outputs.available == 'true' }}
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 -d -o $CERTIFICATE_PATH
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..
- name: Compile
working-directory: build
run: make -j4
- name: Build app bundle
run: ./macos_bundle.sh ${{ steps.secret-check.outputs.available }}
- name: Notarize app bundle
if: ${{ steps.secret-check.outputs.available == 'true' }}
env:
NOTARIZE_USERNAME: ${{ secrets.NOTARIZE_USERNAME }}
NOTARIZE_TEAM_ID: ${{ secrets.NOTARIZE_TEAM_ID }}
NOTARIZE_PASSWORD: ${{ secrets.NOTARIZE_PASSWORD }}
run: |
ditto -c -k --keepParent Gqrx.app Gqrx.zip
xcrun notarytool submit Gqrx.zip --apple-id "$NOTARIZE_USERNAME" --team-id "$NOTARIZE_TEAM_ID" --password "$NOTARIZE_PASSWORD" --wait
- name: Staple app bundle
if: ${{ steps.secret-check.outputs.available == 'true' }}
run: xcrun stapler staple --verbose Gqrx.app
- name: Create DMG
run: |
GQRX_VERSION=$(<build/version.txt)
hdiutil create Gqrx.dmg -srcfolder Gqrx.app -format UDZO -fs HFS+ -volname "Gqrx $GQRX_VERSION"
- name: Notarize DMG
if: ${{ steps.secret-check.outputs.available == 'true' }}
env:
NOTARIZE_USERNAME: ${{ secrets.NOTARIZE_USERNAME }}
NOTARIZE_TEAM_ID: ${{ secrets.NOTARIZE_TEAM_ID }}
NOTARIZE_PASSWORD: ${{ secrets.NOTARIZE_PASSWORD }}
run: |
xcrun notarytool submit Gqrx.dmg --apple-id "$NOTARIZE_USERNAME" --team-id "$NOTARIZE_TEAM_ID" --password "$NOTARIZE_PASSWORD" --wait
- name: Staple DMG
if: ${{ steps.secret-check.outputs.available == 'true' }}
run: xcrun stapler staple --verbose Gqrx.dmg
- name: Rename DMG
run: |
GQRX_VERSION=$(<build/version.txt)
mv Gqrx.dmg Gqrx-$GQRX_VERSION.dmg
- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: gqrx-macos-${{ matrix.arch }}-${{ github.run_id }}
path: Gqrx-*.dmg
windows:
runs-on: windows-latest
name: Windows
defaults:
run:
shell: msys2 {0}
steps:
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
git
make
pacboy: >-
toolchain:p
cmake:p
ninja:p
libusb:p
boost:p
qt6-base:p
qt6-svg:p
spdlog:p
volk:p
libsndfile:p
soapysdr:p
fftw:p
- name: Clone and build GNU Radio
working-directory: ${{ runner.temp }}
run: |
git clone --branch v3.10.11.0 --depth 1 https://github.com/gnuradio/gnuradio.git
cd gnuradio
cmake -S . -B build \
-DCMAKE_INSTALL_PREFIX=${RUNNER_TEMP}/msys64/mingw64 \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_DEFAULT=OFF \
-DENABLE_COMMON_PCH=ON \
-DENABLE_GNURADIO_RUNTIME=ON \
-DENABLE_GR_ANALOG=ON \
-DENABLE_GR_AUDIO=ON \
-DENABLE_GR_BLOCKS=ON \
-DENABLE_GR_DIGITAL=ON \
-DENABLE_GR_FFT=ON \
-DENABLE_GR_FILTER=ON \
-DENABLE_GR_NETWORK=ON
cmake --build build
cmake --install build
- name: Clone and build rtl-sdr
working-directory: ${{ runner.temp }}
run: |
git clone https://gitea.osmocom.org/sdr/rtl-sdr.git
cd rtl-sdr
cmake -S . -B build \
-DCMAKE_INSTALL_PREFIX=${RUNNER_TEMP}/msys64/mingw64 \
-DCMAKE_BUILD_TYPE=Release \
-DDETACH_KERNEL_DRIVER=OFF \
-DENABLE_ZEROCOPY=OFF \
-DINSTALL_UDEV_RULES=OFF
cmake --build build
cmake --install build
- name: Clone and build airspyone_host
working-directory: ${{ runner.temp }}
run: |
git clone https://github.com/airspy/airspyone_host.git
cd airspyone_host
cmake -S . -B build \
-G "MinGW Makefiles" \
-DCMAKE_INSTALL_PREFIX=${RUNNER_TEMP}/msys64/mingw64
cmake --build build
cmake --install build
- name: Clone and build airspyhf
working-directory: ${{ runner.temp }}
run: |
git clone https://github.com/airspy/airspyhf.git
cd airspyhf
cmake -S . -B build \
-G "MSYS Makefiles" \
-DCMAKE_INSTALL_PREFIX=${RUNNER_TEMP}/msys64/mingw64 \
-DTHREADS_PTHREADS_INCLUDE_DIR=${RUNNER_TEMP}/msys64/mingw64/include \
-DTHREADS_PTHREADS_WIN32_LIBRARY=${RUNNER_TEMP}/msys64/mingw64/lib/libpthread.a
cmake --build build
cmake --install build
- name: Clone and build gr-osmosdr
working-directory: ${{ runner.temp }}
run: |
git clone https://gitea.osmocom.org/sdr/gr-osmosdr.git
cd gr-osmosdr
cmake -S . -B build \
-DCMAKE_INSTALL_PREFIX=${RUNNER_TEMP}/msys64/mingw64 \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_DEFAULT=OFF \
-DENABLE_AIRSPY=ON \
-DENABLE_AIRSPYHF=ON \
-DENABLE_FILE=ON \
-DENABLE_REDPITAYA=ON \
-DENABLE_RTL=ON \
-DENABLE_RTL_TCP=ON \
-DENABLE_SOAPY=ON
cmake --build build
cmake --install build
- name: Configure git
run: git config --global core.autocrlf input
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure, compile & install
run: |
cmake -S . -B build \
-DCMAKE_INSTALL_PREFIX=C:/gqrx \
-DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build
- name: Deploy Qt application
working-directory: ${{ runner.temp }}/msys64/mingw64/bin
run: |
windeployqt6 C:/gqrx/bin/gqrx.exe
cp \
libairspy.dll \
libairspyhf.dll \
libb2-1.dll \
libboost_program_options-mt.dll \
libboost_thread-mt.dll \
libbrotlicommon.dll \
libbrotlidec.dll \
libbz2-1.dll \
libdouble-conversion.dll \
libfftw3f-3.dll \
libfftw3f_threads-3.dll \
libFLAC.dll \
libfmt-11.dll \
libfreetype-6.dll \
libgcc_s_seh-1.dll \
libglib-2.0-0.dll \
libgmp-10.dll \
libgnuradio-*.dll \
libgraphite2.dll \
libharfbuzz-0.dll \
libiconv-2.dll \
libicudt75.dll \
libicuin75.dll \
libicuuc75.dll \
libintl-8.dll \
libmd4c.dll \
libmp3lame-0.dll \
libmpg123-0.dll \
libogg-0.dll \
libopus-0.dll \
liborc-0.4-0.dll \
libpcre2-16-0.dll \
libpcre2-8-0.dll \
libpng16-16.dll \
librtlsdr.dll \
libsndfile-1.dll \
libSoapySDR.dll \
libspdlog.dll \
libstdc++-6.dll \
libusb-1.0.dll \
libvolk.dll \
libvorbis-0.dll \
libvorbisenc-2.dll \
libwinpthread-1.dll \
libzstd.dll \
zlib1.dll \
C:/gqrx/bin/
- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: gqrx-windows-${{ github.run_id }}
path: C:/gqrx/bin