mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
ci: build the Windows NSIS installer in the MSVC job
Install NSIS via choco (not preinstalled on windows-latest), Ghostscript via choco, and the Roboto/Roboto Mono fonts (matching the exact versions Fedora's google-roboto-fonts and google-roboto-mono-fonts packages ship, dropped straight into %windir%\Fonts, which doc/findfont.ph's directory-scan fallback picks up without needing font registration). Then run 'nmake docs' (builds nasmdoc.pdf via NASM's own Perl-based doc toolchain, which needs exactly those tools -- see doc/source.src) followed by 'nmake nsis' to produce the installer via nsis/nasm.nsi, and upload it as a workflow artifact. Ghostscript is located by doc/pspdf.pl via the Windows registry keys the official installer creates, not via PATH, so no PATH setup is needed for it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
c68bf5ef57
commit
186be201d5
1 changed files with 69 additions and 0 deletions
69
.github/workflows/test.yml
vendored
69
.github/workflows/test.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue