Build & Package Windows #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# -- Windows - build, build manual, package, and upload | |
# runs manually | |
# | |
name: Build & Package Windows | |
on: | |
workflow_dispatch: | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
name: Build & Package Windows | |
runs-on: windows-latest | |
steps: | |
- name: Enable Developer Command Prompt | |
uses: ilammy/[email protected] | |
- name: Checkout GLE | |
uses: actions/checkout@v4 | |
- name: Checkout GLE Library | |
uses: actions/checkout@v4 | |
with: | |
repository: "vlabella/gle-library" | |
path: gle-library | |
- name: Checkout GLE Manual | |
uses: actions/checkout@v4 | |
with: | |
repository: "vlabella/gle-manual" | |
path: gle-manual | |
- name: Acquire vcpkg | |
uses: actions/checkout@v4 | |
with: | |
repository: "Microsoft/vcpkg" | |
path: vcpkg | |
- name: Bootstrap vcpkg | |
run: "${{ github.workspace }}\\vcpkg\\bootstrap-vcpkg.bat" | |
shell: cmd | |
- name: Enable GitHub Actions Cache backend | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- name: Install ECM package using vcpkg | |
run: "${{ github.workspace }}/vcpkg/vcpkg install ecm" | |
shell: cmd | |
# header files needed for building of GLE | |
- name: Acquire Ghostscipt/PDL | |
uses: actions/checkout@v4 | |
with: | |
repository: "ArtifexSoftware/ghostpdl" | |
path: ghostpdl | |
# needed for building of manual | |
- name: Choco Install MikTeX | |
uses: crazy-max/ghaction-chocolatey@v3 | |
with: | |
args: install miktex --no-progress | |
# needed for building of manual | |
- name: Choco Install Ghostscript | |
uses: crazy-max/ghaction-chocolatey@v3 | |
with: | |
args: install ghostscript --no-progress | |
# gs version number hard coded - will fail when version number changes | |
- name: Add MikTeX and Ghostcript to PATH using PowerShell | |
shell: pwsh | |
run: | | |
echo "C:\Program Files\MikTeX\miktex\bin\x64;C:\Program Files\gs\gs10.04.0\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
# if this fails then gs version is wrong | |
- name: Display gs version | |
shell: cmd | |
run: gswin64c --version | |
- name: Configure MikTeX | |
shell: cmd | |
run: | | |
initexmf --admin --verbose --set-config-value=[MPM]AutoInstall=1 | |
miktex --admin --verbose packages update-package-database | |
miktex --admin --verbose packages update | |
miktex --verbose packages update | |
miktex --admin --verbose packages install cm-super | |
miktex --admin --verbose fndb refresh | |
initexmf --admin --verbose --update-fndb | |
initexmf --admin --verbose --mklinks --force | |
updmap --admin | |
- name: Configure CMake | |
run: > | |
cmake -S ${{github.workspace}}\src -B ${{github.workspace}}\build | |
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
-DVCPKG_TARGET_TRIPLET=x64-windows-static-release | |
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
-DGHOSTPDL_ROOT=${{github.workspace}}/ghostpdl | |
-DMSVC_USE_STATIC_RUNTIME=ON | |
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/stage | |
-DGLE_EXAMPLES_LIBRARY_PATH="${{github.workspace}}/gle-library" | |
-DGLE_USER_MANUAL_PATH="${{github.workspace}}/gle-manual" | |
-DECM_DIR="${{github.workspace}}/vcpkg/installed/x64-windows/share/ECM" | |
- name: Build | |
run: | | |
cmake --build ${{github.workspace}}\build --config ${{env.BUILD_TYPE}} | |
- name: Install | |
run: | | |
cmake -DBUILD_TYPE=Release -P ${{github.workspace}}\build\cmake_install.cmake | |
- name: Build Manual | |
working-directory: ${{github.workspace}}\gle-manual | |
run: | | |
nmake /nologo -f Makefile.vc GLE_TOP=${{github.workspace}}\stage | |
- name: Upload Artifacts - GLE Manual PDF | |
uses: actions/[email protected] | |
with: | |
name: GLE PDF Manual | |
path: ${{github.workspace}}\gle-manual\gle-manual.pdf | |
if-no-files-found: warn | |
retention-days: 0 | |
compression-level: 0 | |
- name: Package | |
working-directory: ${{github.workspace}}\build | |
run: | | |
cpack -G "NSIS;ZIP;7Z" -C ${{env.BUILD_TYPE}} -B "${{github.workspace}}\stage" | |
- name: Upload Artifacts - GLE Binary Distributables | |
uses: actions/[email protected] | |
with: | |
name: GLE Binary Distributables ${{ runner.os }} | |
path: ${{github.workspace}}\stage\gle-*.* | |
if-no-files-found: warn | |
retention-days: 0 | |
compression-level: 0 |