---
-name: Windows MSYS2 x86_64
+name: Windows CI
+
+# yamllint disable rule:line-length
+# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
- build:
- runs-on: windows-latest
+ msys2:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
+ os: [windows-2019]
+ carch: [x86_64]
defaults:
run:
shell: msys2 {0}
# with:
# name: test-suite.log
# path: tests/test-suite.log
+ MSVC:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
+ os: [windows-2019]
+ triplet: [x64-windows, x86-windows]
+ include:
+ - os: windows-2019
+ triplet: x64-windows
+ # https://github.com/microsoft/vcpkg/commit/b361c2eefa3966cb7cec45275aff32e90430aaa6
+ vcpkgCommitId: 'b361c2eefa3966cb7cec45275aff32e90430aaa6'
+ vcpkgPackages: 'cairo expat fontconfig freetype gettext glib libpng libxml2 pango pcre zlib'
+ configuration: 'x64'
+ nmake_configuration: 'USE_64BIT=1'
+ - os: windows-2019
+ triplet: x86-windows
+ vcpkgCommitId: 'b361c2eefa3966cb7cec45275aff32e90430aaa6'
+ vcpkgPackages: 'cairo expat fontconfig freetype gettext glib libpng libxml2 pango pcre zlib'
+ configuration: 'x86'
+ nmake_configuration: ''
+ defaults:
+ run:
+ shell: cmd
+ env:
+ buildDir: '${{ github.workspace }}/build/'
+ steps:
+ - uses: actions/checkout@v1
+ with:
+ submodules: true
+
+ # Restore from cache the previously built ports. If cache-miss, download and build vcpkg (aka "bootstrap vcpkg").
+ - name: Restore from cache and install vcpkg
+ # Download and build vcpkg.
+ uses: lukka/run-vcpkg@v7
+ with:
+ setupOnly: false
+ # Location of vcpkg in the Git repository.
+ vcpkgDirectory: '${{ github.workspace }}/vcpkg'
+ vcpkgGitCommitId: '${{ matrix.vcpkgCommitId}}'
+ vcpkgTriplet: ${{ matrix.triplet }}
+ vcpkgArguments: '${{ matrix.vcpkgPackages }}'
+ # Ensure the vcpkg artifacts are cached, they are generated in the 'CMAKE_BINARY_DIR/vcpkg_installed' directory.
+ additionalCachedPaths: ${{ env.buildDir }}/vcpkg_installed
+ - name: Build ${{ matrix.configuration }}
+ run: |
+ call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.configuration }}
+ nmake -f win32\Makefile_vcpkg.msc ${{ matrix.nmake_configuration }}
--- /dev/null
+---
+name: Release Windows
+
+# yamllint disable rule:line-length
+# yamllint disable-line rule:truthy
+on:
+ push:
+ tags:
+ - '*'
+ workflow_dispatch:
+
+defaults:
+ run:
+ shell: cmd
+
+jobs:
+ MSVC:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
+ os: [windows-2019]
+ triplet: [x64-windows, x86-windows]
+ include:
+ - os: windows-2019
+ triplet: x64-windows
+ # https://github.com/microsoft/vcpkg/commit/b361c2eefa3966cb7cec45275aff32e90430aaa6
+ vcpkgCommitId: 'b361c2eefa3966cb7cec45275aff32e90430aaa6'
+ vcpkgPackages: 'cairo expat fontconfig freetype gettext glib libpng libxml2 pango pcre zlib'
+ configuration: 'x64'
+ nmake_configuration: 'USE_64BIT=1'
+ - os: windows-2019
+ triplet: x86-windows
+ vcpkgCommitId: 'b361c2eefa3966cb7cec45275aff32e90430aaa6'
+ vcpkgPackages: 'cairo expat fontconfig freetype gettext glib libpng libxml2 pango pcre zlib'
+ configuration: 'x86'
+ nmake_configuration: ''
+ env:
+ buildDir: '${{ github.workspace }}/build/'
+ steps:
+ - uses: actions/checkout@v1
+ with:
+ submodules: true
+
+ # Restore from cache the previously built ports. If cache-miss, download and build vcpkg (aka "bootstrap vcpkg").
+ - name: Restore from cache and install vcpkg
+ # Download and build vcpkg.
+ uses: lukka/run-vcpkg@v7
+ with:
+ setupOnly: false
+ # Location of vcpkg in the Git repository.
+ vcpkgDirectory: '${{ github.workspace }}/vcpkg'
+ vcpkgGitCommitId: '${{ matrix.vcpkgCommitId}}'
+ vcpkgTriplet: ${{ matrix.triplet }}
+ vcpkgArguments: '${{ matrix.vcpkgPackages }}'
+ # Ensure the vcpkg artifacts are cached, they are generated in the 'CMAKE_BINARY_DIR/vcpkg_installed' directory.
+ additionalCachedPaths: ${{ env.buildDir }}/vcpkg_installed
+ - name: Build ${{ matrix.configuration }}
+ run: |
+ call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.configuration }}
+ nmake -f win32\Makefile_vcpkg.msc ${{ matrix.nmake_configuration }}
+ - name: Collect files
+ run: |
+ win32\collect_rrdtool_vcpkg_files.bat ${{ matrix.configuration }}
+ - uses: actions/upload-artifact@v2
+ with:
+ name: deploy-rrdtool-MSVC-${{ matrix.configuration }}
+ path: win32/nmake_release_${{ matrix.configuration }}_vcpkg/rrdtool-*-${{ matrix.configuration }}_vcpkg/
/I $(ARCH_PATH)\include \\r
/I $(ARCH_PATH)\include\cairo \\r
/I $(ARCH_PATH)\include\pango-1.0 \\r
+ /I $(ARCH_PATH)\include\harfbuzz \\r
/I $(ARCH_PATH)\include\glib-2.0 \\r
/I $(ARCH_PATH)\lib\glib-2.0\include \\r
/I $(ARCH_PATH)\include\libxml2\r
--- /dev/null
+@ echo off\r
+REM This script collects the built .exe and .dll files required for running RRDtool.\r
+REM It is supposed to be run after an MSVC build using nmake and libraries from vcpkg.\r
+REM Wolfgang Stöggl <c72578@yahoo.de>, 2017-2021.\r
+\r
+REM Run the batch file with command line parameter x64 or x86\r
+if "%1"=="" (\r
+ echo Command line parameter required: x64 or x86\r
+ echo e.g.: %~nx0 x64\r
+ exit /b\r
+)\r
+echo configuration: %1\r
+\r
+REM The script is located in the subdirectory win32\r
+echo %~dp0\r
+pushd %~dp0\r
+SET base_dir=..\r
+\r
+REM Read current version of RRDtool\r
+SET /p version=<%base_dir%\VERSION\r
+echo RRDtool version: %version%\r
+\r
+SET release_dir=%base_dir%\win32\nmake_release_%1_vcpkg\rrdtool-%version%-%1_vcpkg\\r
+echo release_dir: %release_dir%\r
+\r
+if exist %base_dir%\win32\nmake_release_%1_vcpkg rmdir %base_dir%\win32\nmake_release_%1_vcpkg /s /q\r
+mkdir %release_dir%\r
+\r
+REM use xcopy instead of copy. xcopy creates directories if necessary and outputs the copied file\r
+REM /Y Suppresses prompting to confirm that you want to overwrite an existing destination file.\r
+REM /D xcopy copies all Source files that are newer than existing Destination files\r
+\r
+xcopy /Y /D %base_dir%\win32\librrd-8.dll %release_dir%\r
+xcopy /Y /D %base_dir%\win32\rrdcgi.exe %release_dir%\r
+xcopy /Y /D %base_dir%\win32\rrdtool.exe %release_dir%\r
+xcopy /Y /D %base_dir%\win32\rrdupdate.exe %release_dir%\r
+\r
+REM The following part needs to be checked and maintained after an update to a new vcpkg version\r
+REM Names of dlls can change over time, which has happened in the past\r
+REM e.g. glib-2.dll -> glib-2.0-0.dll, expat.dll -> libexpat.dll\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\brotlicommon.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\brotlidec.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\bz2.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\cairo-2.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\libexpat.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\libffi.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\fontconfig-1.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\freetype.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\fribidi-0.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\gio-2.0-0.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\glib-2.0-0.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\gmodule-2.0-0.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\gobject-2.0-0.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\harfbuzz.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\iconv-2.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\intl-8.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\libpng16.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\libxml2.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\lzma.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\pango-1.0-0.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\pangocairo-1.0-0.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\pangoft2-1.0-0.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\pangowin32-1.0-0.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\pcre.dll %release_dir%\r
+xcopy /Y /D %base_dir%\vcpkg\installed\%1-windows\bin\zlib1.dll %release_dir%\r
+\r
+popd\r