name: Build FreeDV (Windows) on: push: branches-ignore: - 'dr-render-manual' concurrency: group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} cancel-in-progress: true env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Debug jobs: build: # The CMake configure and build commands are platform agnostic and should work equally # well on Windows or Mac. You can convert this to a matrix build if you need # cross-platform coverage. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix outputs: INSTALLER_FILENAME: ${{ steps.installer-filename.outputs.INSTALLER_FILENAME }} strategy: fail-fast: false matrix: arch: [x86_64, aarch64] runs-on: ubuntu-22.04 env: PKCS11_PROXY_SOCKET: tcp://127.0.0.1:2222 FREEDV_WINDOWS_CODE_SIGNING_SSH_KEY: ${{ secrets.FREEDV_WINDOWS_CODE_SIGNING_SSH_KEY }} steps: - uses: actions/checkout@v6 - name: Install required packages shell: bash working-directory: ${{github.workspace}} run: | sudo apt-get update sudo apt-get install nsis autoconf automake libtool libltdl-dev pkg-config - name: Download MinGW LLVM shell: bash working-directory: ${{github.workspace}} run: | wget https://github.com/mstorsjo/llvm-mingw/releases/download/20251216/llvm-mingw-20251216-ucrt-ubuntu-22.04-x86_64.tar.xz tar xvf llvm-mingw-20251216-ucrt-ubuntu-22.04-x86_64.tar.xz - name: Configure code signing tunnel if: ${{ env.FREEDV_WINDOWS_CODE_SIGNING_SSH_KEY != '' }} working-directory: ${{github.workspace}} env: FREEDV_WINDOWS_CODE_SIGNING_SSH_KEY: ${{ secrets.FREEDV_WINDOWS_CODE_SIGNING_SSH_KEY }} run: | cat <code-sign.sshkey ${{ env.FREEDV_WINDOWS_CODE_SIGNING_SSH_KEY }} EOF chmod 600 code-sign.sshkey mkdir -p ~/.ssh ssh-keyscan -p ${{ secrets.FREEDV_WINDOWS_CODE_SIGNING_SSH_PORT}} ${{ secrets.FREEDV_WINDOWS_CODE_SIGNING_SSH_HOST}} >> ~/.ssh/known_hosts - name: Configure code signing keys if: ${{ env.FREEDV_WINDOWS_CODE_SIGNING_SSH_KEY != '' }} working-directory: ${{github.workspace}} env: FREEDV_WINDOWS_CODE_SIGNING_INTERMEDIATE_CERTS: ${{ secrets.FREEDV_WINDOWS_CODE_SIGNING_INTERMEDIATE_CERTS }} run: | echo -n "${{secrets.FREEDV_WINDOWS_CODE_SIGNING_CERT}}" >freedv.cert echo -n "${{secrets.FREEDV_WINDOWS_CODE_SIGNING_KEY}}" >freedv.key echo -n "${{secrets.FREEDV_WINDOWS_SECONDARY_CODE_SIGNING_CERT}}" >freedv-secondary.cert echo -n "${{secrets.FREEDV_WINDOWS_SECONDARY_CODE_SIGNING_KEY}}" >freedv-secondary.key cat <freedv.intermediatecerts ${{ env.FREEDV_WINDOWS_CODE_SIGNING_INTERMEDIATE_CERTS }} EOF - name: Configure code signing packages if: ${{ env.FREEDV_WINDOWS_CODE_SIGNING_SSH_KEY != '' }} working-directory: ${{github.workspace}} run: | sudo apt-get install pcsc-tools pcscd libfuse2 opensc opensc-pkcs11 libengine-pkcs11-openssl gnutls-bin git clone https://github.com/mtrojnar/osslsigncode.git cd osslsigncode mkdir build cd build cmake .. make -j$(nproc) cd ${{github.workspace}} git clone https://github.com/iksaif/pkcs11-proxy.git cd pkcs11-proxy mkdir build cd build cmake .. make -j$(nproc) - name: Configure freedv-gui (unsigned) shell: bash if: ${{ env.FREEDV_WINDOWS_CODE_SIGNING_SSH_KEY == '' }} working-directory: ${{github.workspace}} run: | export PATH=${{github.workspace}}/llvm-mingw-20251216-ucrt-ubuntu-22.04-x86_64/bin:$PATH mkdir build_windows cd build_windows cmake -DENABLE_LTO=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/cross-compile/freedv-mingw-llvm-${{ matrix.arch }}.cmake .. - name: Configure freedv-gui (signed) if: ${{ env.FREEDV_WINDOWS_CODE_SIGNING_SSH_KEY != '' }} shell: bash working-directory: ${{github.workspace}} run: | export PATH=${{github.workspace}}/llvm-mingw-20251216-ucrt-ubuntu-22.04-x86_64/bin:${{github.workspace}}/osslsigncode/build:$PATH mkdir build_windows cd build_windows cmake -DENABLE_LTO=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSIGN_WINDOWS_BINARIES=1 -DPKCS11_MODULE=${{github.workspace}}/pkcs11-proxy/build/libpkcs11-proxy.so -DPKCS11_CERTIFICATE_FILE=${{github.workspace}}/freedv.cert -DPKCS11_KEY_FILE=${{github.workspace}}/freedv.key -DPKCS11_SECONDARY_CERTIFICATE_FILE=${{github.workspace}}/freedv-secondary.cert -DPKCS11_SECONDARY_KEY_FILE=${{github.workspace}}/freedv-secondary.key -DINTERMEDIATE_CERT_FILE=${{github.workspace}}/freedv.intermediatecerts -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/cross-compile/freedv-mingw-llvm-${{ matrix.arch }}.cmake .. - name: Build freedv-gui (unsigned) if: ${{ env.FREEDV_WINDOWS_CODE_SIGNING_SSH_KEY == '' }} shell: bash working-directory: ${{github.workspace}}/build_windows run: | export PATH=${{github.workspace}}/llvm-mingw-20251216-ucrt-ubuntu-22.04-x86_64/bin:${{github.workspace}}/osslsigncode/build:$PATH make -j$(nproc) package - name: Build freedv-gui (signed) if: ${{ env.FREEDV_WINDOWS_CODE_SIGNING_SSH_KEY != '' }} shell: bash working-directory: ${{github.workspace}}/build_windows run: | export PATH=${{github.workspace}}/llvm-mingw-20251216-ucrt-ubuntu-22.04-x86_64/bin:${{github.workspace}}/osslsigncode/build:$PATH ssh -fN -o "ServerAliveInterval 60" -p ${{ secrets.FREEDV_WINDOWS_CODE_SIGNING_SSH_PORT }} -i ${{github.workspace}}/code-sign.sshkey -L localhost:2222:127.0.0.1:2222 ${{ secrets.FREEDV_WINDOWS_CODE_SIGNING_SSH_USER }}@${{ secrets.FREEDV_WINDOWS_CODE_SIGNING_SSH_HOST }} make -j$(nproc) package killall ssh - name: Calculate installer filename shell: bash id: installer-filename working-directory: ${{github.workspace}}/build_windows run: | export FREEDV_INSTALLER_FILE=`ls FreeDV*.exe` echo "INSTALLER_FILENAME=${FREEDV_INSTALLER_FILE}" >> "$GITHUB_OUTPUT" - name: Stash for next step uses: actions/upload-artifact@v7 with: name: ${{ steps.installer-filename.outputs.INSTALLER_FILENAME }} path: ${{github.workspace}}/build_windows/${{ steps.installer-filename.outputs.INSTALLER_FILENAME }} test: strategy: fail-fast: false matrix: runner: [windows-2022, windows-11-arm] arch: [x86_64, aarch64] exclude: - runner: windows-2022 arch: aarch64 - runner: windows-11-arm arch: x86_64 runs-on: ${{ matrix.runner }} needs: build env: RADIO_TO_COMPUTER_DEVICE: "CABLE Output (VB-Audio Virtual Cable)" COMPUTER_TO_RADIO_DEVICE: "Speakers (VB-Audio Virtual Cable)" MICROPHONE_TO_COMPUTER_DEVICE: "Line 1 (Virtual Audio Cable)" COMPUTER_TO_SPEAKER_DEVICE: "Line 1 (Virtual Audio Cable)" steps: - uses: actions/checkout@v6 - uses: actions/download-artifact@v8 with: merge-multiple: true pattern: FreeDV-2*-${{ matrix.arch }}.exe path: ${{github.workspace}} - uses: TheMrMilchmann/setup-msvc-dev@v4 with: arch: x64 - name: Install VB-Cable ("Radio" sound device) run: | Invoke-WebRequest https://download.vb-audio.com/Download_CABLE/VBCABLE_Driver_Pack45.zip -OutFile VBCABLE_Driver_Pack45.zip Expand-Archive -Path VBCABLE_Driver_Pack45.zip -DestinationPath VBCABLE_Driver_Pack45 $driverFile = 'VBCable_Driver_Pack45\vbaudio_cable64_win10.sys'; $outputFile = '${{github.workspace}}\vbcable.cer'; $exportType = [System.Security.Cryptography.X509Certificates.X509ContentType]::Cert; $cert = (Get-AuthenticodeSignature $driverFile).SignerCertificate; [System.IO.File]::WriteAllBytes($outputFile, $cert.Export($exportType)); .\ci\Install-Driver.ps1 $outputFile VBCable_Driver_Pack45\vbMmeCable64_win10.inf VBAudioVACWDM - name: Install VAC ("analog" sound device) run: | Invoke-WebRequest https://software.muzychenko.net/freeware/vac470lite.zip -OutFile vac470lite.zip Expand-Archive -Path vac470lite.zip -DestinationPath vac470lite $driverFile = 'vac470lite\${{ env.Platform }}\vrtaucbl.sys'; $outputFile = '${{github.workspace}}\vac.cer'; $exportType = [System.Security.Cryptography.X509Certificates.X509ContentType]::Cert; $cert = (Get-AuthenticodeSignature $driverFile).SignerCertificate; [System.IO.File]::WriteAllBytes($outputFile, $cert.Export($exportType)); .\ci\Install-Driver.ps1 $outputFile "vac470lite/vrtaucbl.inf" VirtualAudioCable_83ed7f0e-2028-4956-b0b4-39c76fdaef1d - name: Screenshot if failed if: failure() shell: pwsh run: | Invoke-WebRequest https://raw.githubusercontent.com/npocmaka/batch.scripts/refs/heads/master/hybrids/.net/c/screenCapture.bat -OutFile screenCapture.bat & .\screenCapture.bat screenshot.png - name: Upload screenshot uses: actions/upload-artifact@v7 if: failure() with: name: screenshot.png path: ${{github.workspace}}/screenshot.png - name: Install FreeDV on hard drive shell: pwsh run: | Get-ChildItem *.exe | Rename-Item -NewName FreeDV.exe .\FreeDV.exe /S /D=${{github.workspace}}\FreeDV-Install-Location | Out-Null - name: Copy test scripts to install folder shell: pwsh run: | Copy-Item -Path ${{github.workspace}}/test/TestFreeDVFullDuplex.ps1 -Destination ${{github.workspace}}\FreeDV-Install-Location\bin Copy-Item -Path ${{github.workspace}}/test/freedv-ctest-fullduplex.conf.tmpl -Destination ${{github.workspace}}\FreeDV-Install-Location\bin Copy-Item -Path ${{github.workspace}}/test/TestFreeDVReporting.ps1 -Destination ${{github.workspace}}\FreeDV-Install-Location\bin Copy-Item -Path ${{github.workspace}}/test/freedv-ctest-reporting.conf.tmpl -Destination ${{github.workspace}}\FreeDV-Install-Location\bin Copy-Item -Path ${{github.workspace}}/test/hamlibserver.py -Destination ${{github.workspace}}\FreeDV-Install-Location\bin - name: Install SoX shell: pwsh run: | choco install sox.portable - name: Grant FreeDV access to the microphone run: | New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore" -Name "microphone" -Force Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone" -Name Value -Value Allow New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore" -Name "microphone" -Force Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone" -Name Value -Value Allow New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone\" -Name "NonPackaged" -Force Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone\NonPackaged" -Name Value -Value Allow New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\" -Name "AppPrivacy" -Force Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name LetAppsAccessMicrophone -Value 0 - name: Start Windows Audio Service run: | Restart-Service -Name audiosrv -Force - name: List audio devices shell: pwsh run: | Get-CimInstance win32_sounddevice - name: Test RADE shell: pwsh working-directory: ${{github.workspace}}\FreeDV-Install-Location\bin if: ${{ !cancelled() }} run: | .\TestFreeDVFullDuplex.ps1 -RadioToComputerDevice "${{env.RADIO_TO_COMPUTER_DEVICE}}" -ComputerToRadioDevice "${{env.COMPUTER_TO_RADIO_DEVICE}}" -MicrophoneToComputerDevice "${{env.MICROPHONE_TO_COMPUTER_DEVICE}}" -ComputerToSpeakerDevice "${{env.COMPUTER_TO_SPEAKER_DEVICE}}" -ModeToTest RADEV1 -NumberOfRuns 1 timeout-minutes: 10 - name: Test RADE Reporting shell: pwsh working-directory: ${{github.workspace}}\FreeDV-Install-Location\bin if: ${{ !cancelled() }} run: | .\TestFreeDVReporting.ps1 -RadioToComputerDevice "${{env.RADIO_TO_COMPUTER_DEVICE}}" -ComputerToRadioDevice "${{env.COMPUTER_TO_RADIO_DEVICE}}" -MicrophoneToComputerDevice "${{env.MICROPHONE_TO_COMPUTER_DEVICE}}" -ComputerToSpeakerDevice "${{env.COMPUTER_TO_SPEAKER_DEVICE}}" timeout-minutes: 10 - name: Test 700D shell: pwsh working-directory: ${{github.workspace}}\FreeDV-Install-Location\bin if: ${{ !cancelled() }} run: | .\TestFreeDVFullDuplex.ps1 -RadioToComputerDevice "${{env.RADIO_TO_COMPUTER_DEVICE}}" -ComputerToRadioDevice "${{env.COMPUTER_TO_RADIO_DEVICE}}" -MicrophoneToComputerDevice "${{env.MICROPHONE_TO_COMPUTER_DEVICE}}" -ComputerToSpeakerDevice "${{env.COMPUTER_TO_SPEAKER_DEVICE}}" -ModeToTest 700D -NumberOfRuns 1 timeout-minutes: 10 - name: Test 700E shell: pwsh working-directory: ${{github.workspace}}\FreeDV-Install-Location\bin if: ${{ !cancelled() }} run: | .\TestFreeDVFullDuplex.ps1 -RadioToComputerDevice "${{env.RADIO_TO_COMPUTER_DEVICE}}" -ComputerToRadioDevice "${{env.COMPUTER_TO_RADIO_DEVICE}}" -MicrophoneToComputerDevice "${{env.MICROPHONE_TO_COMPUTER_DEVICE}}" -ComputerToSpeakerDevice "${{env.COMPUTER_TO_SPEAKER_DEVICE}}" -ModeToTest 700E -NumberOfRuns 1 timeout-minutes: 10 - name: Test 1600 shell: pwsh working-directory: ${{github.workspace}}\FreeDV-Install-Location\bin if: ${{ !cancelled() }} run: | .\TestFreeDVFullDuplex.ps1 -RadioToComputerDevice "${{env.RADIO_TO_COMPUTER_DEVICE}}" -ComputerToRadioDevice "${{env.COMPUTER_TO_RADIO_DEVICE}}" -MicrophoneToComputerDevice "${{env.MICROPHONE_TO_COMPUTER_DEVICE}}" -ComputerToSpeakerDevice "${{env.COMPUTER_TO_SPEAKER_DEVICE}}" -ModeToTest 1600 -NumberOfRuns 1 timeout-minutes: 10