-
Notifications
You must be signed in to change notification settings - Fork 120
571 lines (501 loc) · 22 KB
/
Copy pathbuild.yml
File metadata and controls
571 lines (501 loc) · 22 KB
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
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
name: Build (Docker/Windows)
on:
push:
branches:
- 'main'
tags-ignore:
- 'aiscat-*'
release:
types: [published]
pull_request:
workflow_dispatch:
env:
# Where build outputs are attached: the published GitHub Release on a `release` event,
# otherwise the rolling `Edge` pre-release on pushes to main.
RELEASE_TARGET: ${{ github.event_name == 'release' && github.event.release.tag_name || 'Edge' }}
# Build the tagged commit on a release, otherwise the tip of main.
CHECKOUT_REF: ${{ github.event_name == 'release' && github.event.release.tag_name || 'main' }}
jobs:
bakeHTML:
runs-on: ubuntu-latest
outputs:
run_number: ${{ steps.set_run_number.outputs.run_number }}
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
ref: ${{ env.CHECKOUT_REF }}
fetch-depth: 0
- name: Set run number for downstream jobs
id: set_run_number
run: |
echo "run_number=${{ github.run_number }}" >> $GITHUB_OUTPUT
echo "Run number: ${{ github.run_number }}"
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
- name: Install required tools
run: |
sudo apt-get update
sudo apt-get install gzip xxd -y
- name: Run bake script
run: |
./scripts/build-html.sh
- name: Commit and push changes
if: github.event_name == 'push'
run: |
git add -A
if git diff --cached --quiet; then
echo "Nothing to commit, working tree clean"
exit 0
else
echo "There are changes to be committed"
echo "Changed files:"
git diff --cached --name-only
fi
git config --local user.email "action@github.com"
git config --local user.name "Github Action"
git commit -m "Bake HTML files in WebDB.cpp"
git push origin main
pre_build_checks:
name: Pre-Build Checks
needs: bakeHTML
runs-on: ubuntu-latest
outputs:
run_number: ${{ needs.bakeHTML.outputs.run_number }}
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Spell Check with Typos
uses: crate-ci/typos@v1.46.0
build_debian:
needs: pre_build_checks
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUN_NUMBER: ${{ needs.pre_build_checks.outputs.run_number }}
strategy:
matrix:
distro: ['debian']
codename: ['bullseye', 'bookworm', 'trixie']
arch: ['amd64', 'arm64', 'armhf']
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
ref: ${{ env.CHECKOUT_REF }}
fetch-depth: 0
- name: Set filename
run: echo "filename=ais-catcher_${{ matrix.distro }}_${{ matrix.codename }}_${{ matrix.arch }}.deb" >> $GITHUB_ENV
- name: Setup QEMU
uses: docker/setup-qemu-action@v4
- name: Setup Buildx
uses: docker/setup-buildx-action@v4
- name: Map architecture
id: arch
run: |
case "${{ matrix.arch }}" in
armhf) echo "platform=linux/arm/v7" >> $GITHUB_OUTPUT ;;
*) echo "platform=linux/${{ matrix.arch }}" >> $GITHUB_OUTPUT ;;
esac
- name: Build package
run: |
mkdir -p output
docker run --rm \
--platform ${{ steps.arch.outputs.platform }} \
-v $(pwd):/src \
-v $(pwd)/output:/output \
-w /src \
-e RUN_NUMBER=${RUN_NUMBER} \
${{ matrix.distro }}:${{ matrix.codename }} \
bash scripts/build-debian.sh -o /output
mv output/ais-catcher.deb ${{ env.filename }}
- name: Upload to release
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'release'
run: gh release upload "${{ env.RELEASE_TARGET }}" ${{ env.filename }} --repo ${{ github.repository }} --clobber
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.filename }}
path: ${{ env.filename }}
build_ubuntu:
needs: pre_build_checks
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUN_NUMBER: ${{ needs.pre_build_checks.outputs.run_number }}
strategy:
matrix:
distro: ['ubuntu']
codename: ['focal', 'jammy', 'noble', 'plucky', 'questing', 'resolute']
arch: ['amd64', 'arm64', 'armhf']
exclude:
- codename: 'focal'
arch: 'armhf'
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
ref: ${{ env.CHECKOUT_REF }}
fetch-depth: 0
- name: Set filename
run: echo "filename=ais-catcher_${{ matrix.distro }}_${{ matrix.codename }}_${{ matrix.arch }}.deb" >> $GITHUB_ENV
- name: Setup QEMU
uses: docker/setup-qemu-action@v4
- name: Setup Buildx
uses: docker/setup-buildx-action@v4
- name: Map architecture
id: arch
run: |
case "${{ matrix.arch }}" in
armhf) echo "platform=linux/arm/v7" >> $GITHUB_OUTPUT ;;
*) echo "platform=linux/${{ matrix.arch }}" >> $GITHUB_OUTPUT ;;
esac
- name: Build package
run: |
mkdir -p output
docker run --rm \
--platform ${{ steps.arch.outputs.platform }} \
-v $(pwd):/src \
-v $(pwd)/output:/output \
-w /src \
-e RUN_NUMBER=${RUN_NUMBER} \
${{ matrix.distro }}:${{ matrix.codename }} \
bash scripts/build-debian.sh -o /output
mv output/ais-catcher.deb ${{ env.filename }}
- name: Upload to release
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'release'
run: gh release upload "${{ env.RELEASE_TARGET }}" ${{ env.filename }} --repo ${{ github.repository }} --clobber
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.filename }}
path: ${{ env.filename }}
build_fedora:
needs: pre_build_checks
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUN_NUMBER: ${{ needs.pre_build_checks.outputs.run_number }}
strategy:
matrix:
version: ['43', '44']
arch: ['x86_64', 'aarch64']
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
ref: ${{ env.CHECKOUT_REF }}
fetch-depth: 0
- name: Set filename
run: echo "filename=ais-catcher_fedora_${{ matrix.version }}_${{ matrix.arch }}.rpm" >> $GITHUB_ENV
- name: Setup QEMU
uses: docker/setup-qemu-action@v4
- name: Setup Buildx
uses: docker/setup-buildx-action@v4
- name: Map architecture
id: arch
run: |
case "${{ matrix.arch }}" in
aarch64) echo "platform=linux/arm64" >> $GITHUB_OUTPUT ;;
*) echo "platform=linux/amd64" >> $GITHUB_OUTPUT ;;
esac
- name: Build package
run: |
mkdir -p output
docker run --rm \
--platform ${{ steps.arch.outputs.platform }} \
-v $(pwd):/src \
-v $(pwd)/output:/output \
-w /src \
-e RUN_NUMBER=${RUN_NUMBER} \
fedora:${{ matrix.version }} \
bash scripts/build-fedora.sh -o /output
mv output/ais-catcher.rpm ${{ env.filename }}
- name: Upload to release
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'release'
run: gh release upload "${{ env.RELEASE_TARGET }}" ${{ env.filename }} --repo ${{ github.repository }} --clobber
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.filename }}
path: ${{ env.filename }}
test_install:
runs-on: ubuntu-latest
needs: [build_debian, build_ubuntu, build_fedora]
strategy:
fail-fast: false
matrix:
include:
- { distro: debian, codename: bullseye, arch: amd64 }
- { distro: debian, codename: bullseye, arch: arm64 }
- { distro: debian, codename: bullseye, arch: armhf }
- { distro: debian, codename: bookworm, arch: amd64 }
- { distro: debian, codename: bookworm, arch: arm64 }
- { distro: debian, codename: bookworm, arch: armhf }
- { distro: debian, codename: trixie, arch: amd64 }
- { distro: debian, codename: trixie, arch: arm64 }
- { distro: debian, codename: trixie, arch: armhf }
- { distro: ubuntu, codename: focal, arch: amd64 }
- { distro: ubuntu, codename: focal, arch: arm64 }
- { distro: ubuntu, codename: jammy, arch: amd64 }
- { distro: ubuntu, codename: jammy, arch: arm64 }
- { distro: ubuntu, codename: jammy, arch: armhf }
- { distro: ubuntu, codename: noble, arch: amd64 }
- { distro: ubuntu, codename: noble, arch: arm64 }
- { distro: ubuntu, codename: noble, arch: armhf }
- { distro: ubuntu, codename: plucky, arch: amd64 }
- { distro: ubuntu, codename: plucky, arch: arm64 }
- { distro: ubuntu, codename: plucky, arch: armhf }
- { distro: fedora, codename: '43', arch: amd64 }
- { distro: fedora, codename: '44', arch: amd64 }
- { distro: fedora, codename: '44', arch: arm64 }
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Setup QEMU
uses: docker/setup-qemu-action@v4
- name: Map architecture to platform
id: arch
run: |
case "${{ matrix.arch }}" in
armhf) echo "platform=linux/arm/v7" >> $GITHUB_OUTPUT ;;
*) echo "platform=linux/${{ matrix.arch }}" >> $GITHUB_OUTPUT ;;
esac
- name: Test package install and run
run: |
docker run --rm \
--platform ${{ steps.arch.outputs.platform }} \
${{ matrix.distro }}:${{ matrix.codename }} \
bash -c "
set -e
if command -v apt-get >/dev/null; then
apt-get update -qq
apt-get install -y -qq curl
fi
bash <(curl -fsSL https://raw.githubusercontent.com/jvde-github/AIS-catcher/main/scripts/aiscatcher-install) --package --no-systemd --no-user
AIS-catcher -l
"
Docker:
runs-on: ubuntu-latest
needs: build_debian
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
ref: ${{ env.CHECKOUT_REF }}
fetch-depth: 0
- name: Calculate Container Metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=edge,branch=main
type=ref,event=tag
- name: Setup QEMU
uses: docker/setup-qemu-action@v4
- name: Setup Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Images
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64, linux/arm64, linux/arm/v7
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
RUN_NUMBER=${{ needs.bakeHTML.outputs.run_number }}
no-cache: true
Windows:
runs-on: windows-2022
needs: pre_build_checks
env:
RUN_NUMBER: ${{ needs.pre_build_checks.outputs.run_number }}
strategy:
matrix:
platform: [x86, x64]
steps:
- uses: actions/checkout@v6
with:
ref: ${{ env.CHECKOUT_REF }}
fetch-depth: 0
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v3
with:
msbuild-architecture: ${{matrix.platform}}
- name: Restore vcpkg packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: vcpkg integrate install
- name: Install vcpkg packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
vcpkg install libpq:${{matrix.platform}}-windows fftw3:${{matrix.platform}}-windows sqlite3:${{matrix.platform}}-windows openssl:${{matrix.platform}}-windows libusb:${{matrix.platform}}-windows pthread:${{matrix.platform}}-windows zlib:${{matrix.platform}}-windows soxr:${{matrix.platform}}-windows zeromq:${{matrix.platform}}-windows
- name: Setting up directories
run: |
mkdir output; cd output; mkdir plugins; mkdir Licenses; cd ..; mkdir include; cd include; mkdir curl; mkdir openssl; cd ..; mkdir release; mkdir lib;
cp C:\vcpkg\installed\${{matrix.platform}}-windows\include\*.h include
cp C:\vcpkg\installed\${{matrix.platform}}-windows\include\openssl\*.h include\openssl
cp C:\vcpkg\installed\${{matrix.platform}}-windows\lib\*.lib lib
cp C:\vcpkg\installed\${{matrix.platform}}-windows\bin\*.dll release
- name: Create start.bat
run: |
cd output
echo "AIS-catcher -v 10 -X -u 127.0.0.1 10110 -N 8100 PLUGIN_DIR plugins`nPAUSE" |Out-File -FilePath start.bat -Encoding ascii
@'
@echo off
if "%1"=="browser" goto browser
start "" /min cmd /c ""%~f0" browser"
AIS-catcher -E 127.0.0.1:8118
PAUSE
exit /b
:browser
timeout /t 1 >nul
set "EDGE=%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge.exe"
if not exist "%EDGE%" set "EDGE=%ProgramFiles%\Microsoft\Edge\Application\msedge.exe"
if exist "%EDGE%" (start "" "%EDGE%" --app=http://127.0.0.1:8118/) else (start "" http://127.0.0.1:8118/)
exit /b
'@ | Out-File -FilePath start-GUI.bat -Encoding ascii
cd ..
- name: Building Libraries and AIS-catcher
run: |
echo "x64" > x64-a; echo "Win32" > x86-a; $msplatform = $(cat "${{matrix.platform}}-a")
$gen = "Visual Studio 17 2022"
$config = "Release"
$libusb_inc = "C:\vcpkg\installed\${{matrix.platform}}-windows\include\libusb-1.0"
$libusb_lib = "C:\vcpkg\installed\${{matrix.platform}}-windows\lib\libusb-1.0.lib"
$pthread_lib = "C:\vcpkg\installed\${{matrix.platform}}-windows\lib\pthreadVC3.lib"
$pthread_inc = "C:\vcpkg\installed\${{matrix.platform}}-windows\include"
$fftw3_lib = "C:\vcpkg\installed\${{matrix.platform}}-windows\lib\fftw3.lib"
$fftw3_inc = "C:\vcpkg\installed\${{matrix.platform}}-windows\include"
echo "RTLSDR"
git clone https://github.com/jvde-github/rtl-sdr.git
cd rtl-sdr; mkdir build; cd build
cmake .. -A $msplatform -G $gen -DLIBUSB_FOUND=1 -DLIBUSB_INCLUDE_DIRS="$libusb_inc"
msbuild /verbosity:quiet /m /p:Configuration=$config /p:Platform=$msplatform rtlsdr.sln
cd ..; cd ..
cp rtl-sdr\build\src\Release\*.dll release
cp rtl-sdr\build\src\Release\*.lib lib
cp rtl-sdr\include\*.h include
cp rtl-sdr\COPYING output\Licenses\RTLSDR
echo "AIRSPY HF+"
git clone https://github.com/airspy/airspyhf.git
cd airspyhf; mkdir build; cd build
cmake .. -A $msplatform -G $gen -DLIBUSB_LIBRARIES="$libusb_lib" -DLIBUSB_INCLUDE_DIR="$libusb_inc" -DTHREADS_PTHREADS_WIN32_LIBRARY="$pthread_lib" -DTHREADS_PTHREADS_INCLUDE_DIR="$pthread_inc"
msbuild /verbosity:quiet /m /p:Configuration=$config /p:Platform=$msplatform airspyhf_all.sln
cd ..; cd ..
cp airspyhf\build\libairspyhf\src\Release\*.dll release
cp airspyhf\build\libairspyhf\src\Release\*.lib lib
cp airspyhf\libairspyhf\src\airspyhf.h include
cp airspyhf\LICENSE.BSD output\Licenses\AIRSPYHF
echo "AIRSPY"
git clone https://github.com/airspy/airspyone_host.git
cd airspyone_host; git reset --hard b97309a6a24db161de990d6e4f0432fc94f72cd9; mkdir build; cd build
cmake .. -A $msplatform -G $gen -DLIBUSB_LIBRARIES="$libusb_lib" -DLIBUSB_INCLUDE_DIR="$libusb_inc" -DTHREADS_PTHREADS_WIN32_LIBRARY="$pthread_lib" -DTHREADS_PTHREADS_INCLUDE_DIR="$pthread_inc"
msbuild /verbosity:quiet /m /p:Configuration=$config /p:Platform=$msplatform airspy_all.sln
cd ..; cd ..
cp airspyone_host\build\airspy-tools\src\*.dll release
cp airspyone_host\build\libairspy\src\Release\*.lib lib
cp airspyone_host\libairspy\src\*.h include
cp airspyone_host\airspy-tools\LICENSE.md output\Licenses\AIRSPY
echo "HACK RF"
git clone https://github.com/greatscottgadgets/hackrf.git
cd hackrf; git reset --hard 34cbbe7330d1e11e7967f84da39d04a61bfdf4f1; cd host; mkdir build; cd build
cmake .. -A $msplatform -G $gen -DLIBUSB_LIBRARIES="$libusb_lib" -DLIBUSB_INCLUDE_DIR="$libusb_inc" -DTHREADS_PTHREADS_WIN32_LIBRARY="$pthread_lib" -DTHREADS_PTHREADS_INCLUDE_DIR="$pthread_inc" -DFFTW_LIBRARIES="$fftw3_lib" -DFFTW_INCLUDES="$fftw3_inc"
msbuild /verbosity:quiet /m /p:Configuration=$config /p:Platform=$msplatform HackRF.sln
cd ..; cd ..; cd ..
cp hackrf\host\build\libhackrf\src\Release\*.dll release
cp hackrf\host\build\libhackrf\src\Release\*.lib lib
cp hackrf\host\libhackrf\src\*.h include
cp hackrf\COPYING output\Licenses\HACKRF
# echo "HYDRASDR"
# git clone https://github.com/hydrasdr/hydrasdr-host.git
# cd hydrasdr-host; mkdir build; cd build
# cmake .. -A $msplatform -G $gen -DLIBUSB_LIBRARIES="$libusb_lib" -DLIBUSB_INCLUDE_DIR="$libusb_inc" -DTHREADS_PTHREADS_WIN32_LIBRARY="$pthread_lib" -DTHREADS_PTHREADS_INCLUDE_DIR="$pthread_inc"
# cmake --build . --config $config
# cd ..; cd ..
# cp hydrasdr-host\build\libhydrasdr\src\$config\*.lib lib
# cp hydrasdr-host\libhydrasdr\src\*.h include
# cp hydrasdr-host\LICENSE.md output\Licenses\HYDRASDR
echo "AIS-catcher"
mkdir build; cd build
cmake .. -A $msplatform -G $gen -DPOTHOSSDR_INCLUDE_DIR=${{github.workspace}}\include -DPOTHOSSDR_LIBRARY_DIR=${{github.workspace}}\lib -DPOTHOSSDR_BINARY_DIR=${{github.workspace}}\release -DRUN_NUMBER=$env:RUN_NUMBER
msbuild /verbosity:quiet /m /p:Configuration=$config /p:Platform=$msplatform AIS-catcher.sln
cd ..
cp LICENSE output\Licenses\AIS-catcher
- name: Prepare output
run: cp build\*.dll output; cp build\Release\*.exe output; cp plugins\* output\plugins; cp README.md output;
- name: Smoke test artifact (x64 clean build)
if: matrix.platform == 'x64'
shell: pwsh
run: |
$dest = Join-Path $env:RUNNER_TEMP "smoke-${{matrix.platform}}"
Remove-Item -Recurse -Force $dest -ErrorAction SilentlyContinue
Copy-Item -Recurse output $dest
Add-Type -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32.dll")] public static extern uint SetErrorMode(uint mode);' -Name S -Namespace N -PassThru | Out-Null
[N.S]::SetErrorMode(0x8003) | Out-Null
Push-Location $dest
& .\AIS-catcher.exe -h BUILD
$exit = $LASTEXITCODE
Pop-Location
if ($exit -ne 0) {
throw "Smoke test failed: AIS-catcher.exe -h BUILD exited with $exit (missing DLL or runtime error)"
}
Write-Host "Smoke test PASSED"
- name: Upload Artifacts
uses: actions/upload-artifact@v7
with:
name: "AIS-catcher ${{matrix.platform}}"
path: output
- name: Compress, upload, and delete ZIP file
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Compress-Archive -Path output/* -DestinationPath "output/AIS-catcher ${{matrix.platform}}.zip"
bash -c "gh release upload '${{ env.RELEASE_TARGET }}' './output/AIS-catcher ${{matrix.platform}}.zip' --repo ${{ github.repository }} --clobber"
del "output\AIS-catcher ${{matrix.platform}}.zip"
- name: Download SDRPlay API
run: |
cd "C:/Program Files/"
Invoke-WebRequest -Uri " https://www.sdrplay.com/software/SDRplay_RSP_API-Windows-3.09.exe" -OutFile sdrplay.exe
choco install innoextract
innoextract sdrplay.exe
ren app SDRplay
- name: Building with SDRPlay support
run: |
cp "C:\Program Files\SDRplay\API\docs\SDRplay_RSP_API_Release_Notes_V3.09.pdf" output\Licenses\SDRPLAY.pdf
echo "x64" > x64-a; echo "Win32" > x86-a; $msplatform = $(cat "${{matrix.platform}}-a")
$gen = "Visual Studio 17 2022"
$config = "Release"
echo "AIS-catcher"
Remove-Item build -Recurse
mkdir build; cd build
cmake .. -A $msplatform -G $gen -DPOTHOSSDR_INCLUDE_DIR=${{github.workspace}}\include -DPOTHOSSDR_LIBRARY_DIR=${{github.workspace}}\lib -DPOTHOSSDR_BINARY_DIR=${{github.workspace}}\release -DRUN_NUMBER=$env:RUN_NUMBER
msbuild /verbosity:quiet /m /p:Configuration=$config /p:Platform=$msplatform AIS-catcher.sln
cd ..
cp LICENSE output\Licenses\AIS-catcher
- name: Prepare output SDRPLAY
run: cp build\*.dll output; cp build\Release\*.exe output; cp plugins\* output\plugins; cp README.md output;
- name: Upload Artifacts SDRPLAY
uses: actions/upload-artifact@v7
with:
name: "AIS-catcher SDRPLAY ${{matrix.platform}}"
path: output
- name: Compress, upload, and delete ZIP file
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Compress-Archive -Path output/* -DestinationPath "output/AIS-catcher SDRPLAY ${{matrix.platform}}.zip"
bash -c "gh release upload '${{ env.RELEASE_TARGET }}' './output/AIS-catcher SDRPLAY ${{matrix.platform}}.zip' --repo ${{ github.repository }} --clobber"
del "output\AIS-catcher SDRPLAY ${{matrix.platform}}.zip"