name: Build Windows x86_64 on: workflow_call: inputs: version: description: "WSJT-X version string" required: true type: string hamlib_branch: description: "Hamlib branch to build" required: false type: string default: "4.7.2" cold_build: description: "Bypass workflow dependency and compiler caches without saving them" required: false type: boolean default: false recache: description: "Force ccache to recompile and refresh cached objects" required: false type: boolean default: false save_ccache: description: "Persist compiler objects from a trusted develop build" required: false type: boolean default: false outputs: installer-artifact-id: description: "Installer artifact id, for the SignPath submit step" value: ${{ jobs.build.outputs.installer-artifact-id }} # Also runnable on its own ("Run workflow" / gh workflow run) to build just # the Windows installer, at ~1/6 the cost of the full ci.yml matrix. GitHub # only exposes workflow_dispatch when the trigger is present on the default # branch, so this must be merged to develop before it can be dispatched. # Inputs mirror workflow_call with standalone defaults: hamlib_branch matches # what ci.yml / release.yml actually pass (4.7.2, not the workflow_call legacy # default), and version defaults to a clearly-marked devel string -- overridable # via `-f version=...` -- so a manual build is never mistaken for a release. # release_channel and prerelease_number exist only here, to override # release-state.txt. workflow_dispatch: inputs: version: description: "WSJT-X version string (installer filename + artifact names)" required: false type: string default: "3.2.0-devel" hamlib_branch: description: "Hamlib branch to build" required: false type: string default: "4.7.2" cold_build: description: "Bypass workflow dependency and compiler caches without saving them" required: false type: boolean default: false recache: description: "Force ccache to recompile and refresh cached objects" required: false type: boolean default: false save_ccache: description: "Persist compiler objects when dispatching on develop" required: false type: boolean default: true release_channel: description: "Build release channel" required: false type: choice options: - DEVEL - BETA - RC - GA default: "DEVEL" prerelease_number: description: "Prerelease number when release_channel is BETA or RC" required: false type: string default: "" jobs: build: runs-on: windows-latest timeout-minutes: 100 outputs: installer-artifact-id: ${{ steps.upload_installer.outputs.artifact-id }} env: BOOST_VERSION: 1.91.0 BOOST_SOURCE_SHA256: de5e6b0e4913395c6bdfa90537febd9028ea4c0735d2cdb0cd9b45d5f51264f5 WSJT_WINDOWS_API_FLOOR: "0x0601" VERSION: ${{ inputs.version }} HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} WSJT_PRERELEASE_NUMBER: ${{ inputs.prerelease_number }} defaults: run: shell: msys2 {0} steps: # windows-latest's git defaults to core.autocrlf=true, which converts # text-file line endings during checkout. The converted working tree # then differs from the index, so cmake/getsvn.cmake's git_local_changes # reports DIRTY and the resulting binary's About tab shows # "wsjtx---dirty". Disable autocrlf before checkout so the # working tree matches the index exactly. (No-op on macOS/Linux runners, # which already default to autocrlf=false; this fix is Windows-only.) - name: Disable core.autocrlf before checkout shell: pwsh run: git config --global core.autocrlf false - uses: actions/checkout@v7 - name: Validate workflow inputs shell: bash env: WSJTX_VERSION: ${{ inputs.version }} run: .github/scripts/validate-ci-inputs.sh # Boost is source-built by build-windows-deps so the Windows 7 API floor # and Boost.Atomic patch stay pinned; do not install MSYS2 Boost here. - uses: msys2/setup-msys2@v2 with: msystem: MINGW64 update: true cache: ${{ !inputs.cold_build }} install: >- git make tar mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc-fortran mingw-w64-x86_64-ccache mingw-w64-x86_64-cmake mingw-w64-x86_64-qt5-base mingw-w64-x86_64-qt5-multimedia mingw-w64-x86_64-qt5-serialport mingw-w64-x86_64-qt5-svg mingw-w64-x86_64-qt5-tools mingw-w64-x86_64-qt5-websockets mingw-w64-x86_64-qt5-activeqt mingw-w64-x86_64-fftw mingw-w64-x86_64-libusb mingw-w64-x86_64-portaudio mingw-w64-x86_64-pkg-config mingw-w64-x86_64-nsis mingw-w64-x86_64-ruby autoconf automake libtool # asciidoctor is a Ruby gem (no native MSYS2 package) — needed by # doc/CMakeLists.txt to build the WSJT-X user guide HTML referenced # by Help → Local User Guide. - name: Install asciidoctor (Ruby gem) run: gem install asciidoctor --no-document - name: Select ccache key id: ccache-key shell: bash env: RECACHE: ${{ inputs.recache }} run: .github/scripts/select-ccache-key-suffix.sh - name: Restore ccache id: ccache if: ${{ !inputs.cold_build }} uses: actions/cache/restore@v6 with: path: .ccache key: ccache-windows-x86_64-gcc-${{ github.sha }}${{ steps.ccache-key.outputs.suffix }} restore-keys: | ccache-windows-x86_64-gcc- - name: Configure ccache run: | WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") if [ "${{ inputs.cold_build }}" = "true" ]; then echo "CCACHE_DIR=$(mktemp -d)" >> "$GITHUB_ENV" else echo "CCACHE_DIR=${WORKSPACE}/.ccache" >> "$GITHUB_ENV" fi echo "ccache recache: ${{ inputs.recache }}" if [ "${{ inputs.recache }}" = "true" ]; then echo "CCACHE_RECACHE=1" >> "$GITHUB_ENV" echo "Forcing ccache recache for this run" fi mkdir -p "${WORKSPACE}/.ccache" ccache --version ccache --zero-stats - name: Build Windows dependencies id: windows-deps uses: ./.github/actions/build-windows-deps with: boost_version: ${{ env.BOOST_VERSION }} boost_source_sha256: ${{ env.BOOST_SOURCE_SHA256 }} windows_api_floor: ${{ env.WSJT_WINDOWS_API_FLOOR }} hamlib_branch: ${{ inputs.hamlib_branch }} cold_build: ${{ inputs.cold_build }} save_caches: ${{ github.event_name != 'pull_request' }} - name: Install OmniRig shell: pwsh run: | # Download OmniRig (provides type library embedded in OmniRig.exe for dumpcpp) Invoke-WebRequest -Uri "https://www.dxatlas.com/OmniRig/Files/OmniRig.zip" -OutFile OmniRig.zip Expand-Archive -Path OmniRig.zip -DestinationPath omnirig-extract # Run the installer silently (InnoSetup) $setup = Get-ChildItem -Path omnirig-extract -Filter "*.exe" -Recurse | Select-Object -First 1 if (-not $setup) { throw "No installer found in OmniRig.zip" } Start-Process -FilePath $setup.FullName -ArgumentList '/VERYSILENT','/NORESTART' -Wait # Locate the installed OmniRig.exe (embeds the COM type library) $omnirig = Get-ChildItem -Path "C:\Program Files*\Afreet\OmniRig" -Filter "OmniRig.exe" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 if (-not $omnirig) { throw "OmniRig install failed — OmniRig.exe not found" } echo "OMNIRIG_PATH=$($omnirig.FullName)" >> $env:GITHUB_ENV - name: Configure build and tests run: | WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") OMNIRIG=$(cygpath "${OMNIRIG_PATH}") BOOST_PREFIX="${{ steps.windows-deps.outputs.boost_prefix }}" HAMLIB_PREFIX="${{ steps.windows-deps.outputs.hamlib_prefix }}" cmake -G "MSYS Makefiles" -S . -B wsjtx-build \ -DCMAKE_PREFIX_PATH="${BOOST_PREFIX};${HAMLIB_PREFIX}" \ -DBOOST_ROOT="${BOOST_PREFIX}" \ -DBOOST_INCLUDEDIR="${BOOST_PREFIX}/include" \ -DBOOST_LIBRARYDIR="${BOOST_PREFIX}/lib" \ -DHamlib_INCLUDE_DIR="${HAMLIB_PREFIX}/include" \ -DHamlib_LIBRARY="${HAMLIB_PREFIX}/lib/libhamlib.dll.a" \ -DRIGCTL_EXE="${HAMLIB_PREFIX}/bin/rigctl.exe" \ -DRIGCTLD_EXE="${HAMLIB_PREFIX}/bin/rigctld.exe" \ -DRIGCTLCOM_EXE="${HAMLIB_PREFIX}/bin/rigctlcom.exe" \ -DCMAKE_C_FLAGS="-D_WIN32_WINNT=${WSJT_WINDOWS_API_FLOOR} -DWINVER=${WSJT_WINDOWS_API_FLOOR}" \ -DCMAKE_CXX_FLAGS="-D_WIN32_WINNT=${WSJT_WINDOWS_API_FLOOR} -DWINVER=${WSJT_WINDOWS_API_FLOOR} -DBOOST_USE_WINAPI_VERSION=${WSJT_WINDOWS_API_FLOOR}" \ -DBoost_NO_SYSTEM_PATHS=ON \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DOMNIRIG_TYPE_LIB="${OMNIRIG}" \ -DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch -std=legacy" \ -DWSJT_SKIP_MANPAGES=ON \ -DWSJT_ENABLE_TESTS=ON \ -DWSJT_ENABLE_GUI_SMOKE_TESTS=ON \ -DWSJT_FORTRAN_LIBRARY_VARIANTS=OPENMP_ONLY \ -DWSJT_RELEASE_CHANNEL="${WSJT_RELEASE_CHANNEL}" \ -DWSJT_PRERELEASE_NUMBER="${WSJT_PRERELEASE_NUMBER}" \ -DPFUNIT_DIR="${{ steps.windows-deps.outputs.pfunit_dir }}" \ -DGFTL_DIR="${{ steps.windows-deps.outputs.gftl_dir }}" \ -DGFTL_SHARED_DIR="${{ steps.windows-deps.outputs.gftl_shared_dir }}" \ -DFARGPARSE_DIR="${{ steps.windows-deps.outputs.fargparse_dir }}" \ -Wno-dev - name: Build and test targets id: compile run: cmake --build wsjtx-build -j$(nproc) - name: Show ccache stats if: always() run: ccache --show-stats - name: Report suppressed ccache save if: ${{ !inputs.cold_build && (inputs.save_ccache || inputs.recache) && github.ref != 'refs/heads/develop' }} run: echo "::notice::Not saving ccache because shared compiler caches are published only from develop" - name: Save ccache if: ${{ !inputs.cold_build && success() && (inputs.save_ccache || inputs.recache) && github.ref == 'refs/heads/develop' && steps.ccache.outputs.cache-hit != 'true' }} uses: actions/cache/save@v6 with: path: .ccache key: ${{ steps.ccache.outputs.cache-primary-key }} - name: Run tests id: ctest run: | # Tests that link wsjt_qt (e.g. test_jtty_txstream) pull in the # rig-control code, so their exe imports libhamlib-4.dll. Hamlib is # built --enable-shared into hamlib-prefix, so hamlib-prefix/bin must # be on PATH for the test to load — the mingw runtime DLLs are already # reachable via /mingw64/bin, but hamlib-prefix is not. Without this # the test exits 0xc0000135 (STATUS_DLL_NOT_FOUND) at launch. The # packaged installer is unaffected: cpack's bundle_fixup copies # libhamlib-4.dll in. export PATH="${{ steps.windows-deps.outputs.boost_prefix }}/lib:${{ steps.windows-deps.outputs.hamlib_prefix }}/bin:${PATH}" ctest --output-on-failure --output-junit ctest-results.xml python3 - <<'PY' import xml.etree.ElementTree as ET root = ET.parse('ctest-results.xml').getroot() for name in ('test_wsjtx_live_audio_jtty', 'test_wsjtx_jtty_tx_loopback', 'test_wsjtx_jt9_wav', 'test_wsjtx_jt65_wav', 'test_wsjtx_q65_wav', 'test_wsjtx_fst4_wav', 'test_wsjtx_fst4w_wav'): test = root.find(f".//testcase[@name='{name}']") if test is None or test.find('failure') is not None or test.find('skipped') is not None: raise SystemExit(f'{name} was not executed successfully') print(f'{name} passed') PY working-directory: wsjtx-build - name: Publish test summary if: always() && steps.ctest.conclusion != 'skipped' working-directory: wsjtx-build run: python3 ../.github/scripts/publish-ctest-summary.py "Windows x86_64" >> "$GITHUB_STEP_SUMMARY" - name: Upload test results if: always() && steps.ctest.conclusion != 'skipped' uses: actions/upload-artifact@v7 with: name: ctest-results-windows path: wsjtx-build/ctest-results.xml if-no-files-found: ignore # MAP65 builds by default again. Under OPENMP_ONLY, m65impl resolves # wsjt_fort_common to wsjt_fort_omp, so this keeps the Windows Fortran # linkage covered by CI. - name: Verify binary run: | file wsjtx-build/jt9.exe file wsjtx-build/map65/map65.exe test -f wsjtx-build/map65/map65.exe # Install to a staging prefix so bundle_fixup runs: its install(CODE) # step copies Qt and dependent runtime DLLs next to the installed # executables, making bin/ self-contained. Build-tree binaries are NOT # self-contained (they resolve Qt/libgfortran/libgomp via /mingw64/bin), # so the launch check below must run against the staged install, not the # build tree — otherwise it would fail for binaries that ship fine. - name: Stage install (runs bundle_fixup) run: | WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") cmake --install wsjtx-build --prefix "${WORKSPACE}/stage-main" ls -la "${WORKSPACE}/stage-main/bin" - name: Audit staged runtime DLL imports run: | WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") test -f "${WORKSPACE}/stage-main/bin/map65.exe" test -f "${WORKSPACE}/stage-main/bin/qmap.exe" bash .github/scripts/audit-staged-dll-imports-windows.sh \ "${WORKSPACE}/stage-main/bin" \ "${WORKSPACE}"/stage-main/bin/*.exe \ "${WORKSPACE}"/stage-main/bin/*.dll - name: Smoke-launch staged WSJT-X (clean PATH) id: wsjtx_smoke run: | WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") .github/scripts/smoke-launch-windows.sh \ "${WORKSPACE}/stage-main/bin/wsjtx.exe" \ --startup-smoke-test --rig-name CI-STARTUP - name: Upload WSJT-X startup diagnostics if: failure() && steps.wsjtx_smoke.outcome == 'failure' uses: actions/upload-artifact@v7 with: name: wsjtx-startup-smoke-windows path: launch.out if-no-files-found: ignore retention-days: 7 - name: Smoke-launch staged jt9 (clean PATH) run: | WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") .github/scripts/smoke-launch-windows.sh "${WORKSPACE}/stage-main/bin/jt9.exe" --help - name: Package release tarballs run: | WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") .github/scripts/package-cli-tools.sh \ --platform windows \ --version "${VERSION}" \ --arch x86_64 \ --groups "${WORKSPACE}/CMake/release-tarballs.txt" \ --source "${WORKSPACE}/wsjtx-build" \ --dll-dir "${WORKSPACE}/stage-main/bin" \ --system-dir "$(cygpath -S)" \ --out "${WORKSPACE}/release-tarballs" - name: Smoke-launch release tarballs (clean PATH) run: | WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") .github/scripts/smoke-release-tarballs.sh \ --platform windows \ --version "${VERSION}" \ --target windows-x86_64 \ --groups "${WORKSPACE}/CMake/release-tarballs.txt" \ --dir "${WORKSPACE}/release-tarballs" # Emit an NSIS installer containing the full executable set # (wsjtx.exe, map65.exe, jt9, wsprd, fmtave, fcal, fmeasure + WSJT_BUILD_UTILS # ft8code/jt65code/... + rigctl wrappers + Qt runtime via bundle_fixup). # CMakeLists.txt:1989-1990 sets CPACK_GENERATOR=NSIS on WIN32 and # CPACK_MONOLITHIC_INSTALL=1 packages every install() target. - name: Package NSIS installer id: package_installer run: | cd wsjtx-build # Override CPACK_PACKAGE_VERSION and # CPACK_PACKAGE_FILE_NAME so the NSIS installer filename # matches the tag-derived version exactly, including any # pre-release suffix (-rc1, -beta1, etc.). CMakeLists.txt # VERSION is numeric-only (CMake won't accept suffixes), so # without this override cpack produces wsjtx--win64.exe # while the sign step and upload-artifact paths below expect # wsjtx--win64.exe. release.yml's prepare job # enforces numeric-base parity; this override covers the # suffix gap. # MSYS2 supplies amd64 plugins; NSIS 3.13 can select x86 by default. cpack_args=( -G NSIS -D CPACK_PACKAGE_VERSION="${VERSION}" -D CPACK_PACKAGE_FILE_NAME="wsjtx-${VERSION}-win64" -D 'CPACK_NSIS_EXTRA_DEFINES=Target amd64-unicode' ) if [ "${CPACK_VERBOSE:-0}" = "1" ]; then cpack_args+=(-V) fi if cpack "${cpack_args[@]}"; then ls -la *.exe else cpack_status=$? for nsis_log in _CPack_Packages/*/NSIS/NSISOutput.log; do [ -f "${nsis_log}" ] || continue echo "::group::${nsis_log}" cat "${nsis_log}" echo "::endgroup::" done exit "${cpack_status}" fi - name: Upload NSIS failure diagnostics if: ${{ failure() && steps.package_installer.outcome == 'failure' }} uses: actions/upload-artifact@v7 with: name: nsis-diagnostics-windows path: | wsjtx-build/_CPack_Packages/*/NSIS/NSISOutput.log wsjtx-build/_CPack_Packages/*/NSIS/project.nsi if-no-files-found: warn - name: Verify installer has no Authenticode signature shell: pwsh run: | $installer = Get-Item "wsjtx-build/wsjtx-${{ inputs.version }}-win64.exe" $signature = Get-AuthenticodeSignature $installer.FullName if ($signature.Status -ne 'NotSigned') { throw "Installer Authenticode status is $($signature.Status), expected NotSigned" } - name: Upload installer artifact id: upload_installer uses: actions/upload-artifact@v7 with: name: wsjtx-${{ inputs.version }}-windows-x86_64-installer path: wsjtx-build/wsjtx-${{ inputs.version }}-*.exe - name: Upload build artifacts uses: actions/upload-artifact@v7 with: name: wsjtx-${{ inputs.version }}-windows-x86_64 path: | wsjtx-build/jt9.exe wsjtx-build/wsprd.exe wsjtx-build/wsjtx.exe - name: Upload release tarballs uses: ./.github/actions/upload-release-tarballs with: version: ${{ inputs.version }} target: windows-x86_64 directory: release-tarballs - name: Summarize native caches if: always() shell: bash env: CACHE_STEPS: ${{ toJSON(steps) }} COLD_BUILD: ${{ inputs.cold_build }} RECACHE: ${{ inputs.recache }} run: python .github/scripts/summarize-native-caches.py --compiler >> "$GITHUB_STEP_SUMMARY"