diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a213a3dbc..9206dedac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,6 +61,62 @@ jobs: with: arch: x64 + - name: Install NSIS + # Needed to build the Windows installer (nsis/nasm.nsi) via the + # "nsis" nmake target below. Not preinstalled on windows-latest. + # choco updates the machine PATH, but that doesn't propagate to + # the already-running Actions Runner process (and thus not to + # later steps), so add makensis's directory to $GITHUB_PATH + # explicitly. + run: | + choco install nsis --no-progress -y + Get-Item "${env:ProgramFiles(x86)}\NSIS", "$env:ProgramFiles\NSIS" -ErrorAction SilentlyContinue | + Select-Object -First 1 -ExpandProperty FullName | + Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Install Perl CPAN modules for doc build + # doc/genps.pl's font-metrics computation needs Font::TTF, and + # the wider doc toolchain needs a handful of other non-core + # CPAN modules; see doc/perlbreq.src (generated from + # doc/source.src's requirements list by tools/genperlbreq.pl) + # for the authoritative list. windows-latest ships Strawberry + # Perl, which bundles cpanm. + shell: cmd + run: cpanm --notest Font::TTF JSON Sort::Versions Compress::Zlib Win32::TieRegistry + + - name: Install Ghostscript and doc-build fonts + # nasmdoc.pdf (packaged into the installer) is built via + # doc/pspdf.pl, which shells out to Ghostscript, and + # doc/genps.pl, which needs the Roboto and Roboto Mono font + # files to compute glyph metrics (see doc/source.src, "Optional + # Build Tools"). Neither is preinstalled on windows-latest. + # + # Font versions match what Fedora's google-roboto-fonts (from + # github.com/google/roboto, release v2.138) and + # google-roboto-mono-fonts (from github.com/googlefonts/RobotoMono) + # packages ship, which is known-good: only Bold/BoldItalic/ + # Italic/Regular of Roboto and Bold/Medium/Regular of Roboto + # Mono are actually used by doc/psfonts.ph. Dropping the .ttf + # files straight into %windir%\Fonts is sufficient: findfont.ph + # falls back to scanning that directory directly and identifies + # faces from each file's own name table, no font-registration + # step required. + shell: pwsh + run: | + choco install ghostscript --no-progress -y + + $fontsDir = "$env:windir\Fonts" + + Invoke-WebRequest -Uri "https://github.com/google/roboto/releases/download/v2.138/roboto-unhinted.zip" -OutFile roboto.zip + Expand-Archive -Path roboto.zip -DestinationPath roboto-unhinted + foreach ($f in "Regular", "Bold", "Italic", "BoldItalic") { + Copy-Item "roboto-unhinted\Roboto-$f.ttf" $fontsDir + } + + foreach ($f in "Regular", "Bold", "Medium") { + Invoke-WebRequest -Uri "https://raw.githubusercontent.com/googlefonts/RobotoMono/main/fonts/ttf/RobotoMono-$f.ttf" -OutFile "$fontsDir\RobotoMono-$f.ttf" + } + - name: Build with nmake/cl.exe shell: cmd run: | @@ -76,3 +132,16 @@ jobs: nasm.exe -f bin smoke.asm -o smoke.bin ndisasm.exe -b 64 smoke.bin nasm.exe -f win64 smoke.asm -o smoke.obj + + - name: Build documentation and NSIS installer + shell: cmd + run: | + nmake /f Mkfiles\msvc.mak docs + nmake /f Mkfiles\msvc.mak nsis + + - name: Upload installer artifact + uses: actions/upload-artifact@v7 + with: + name: nasm-windows-installer + path: nasm-*-installer-*.exe + if-no-files-found: error