From 98583190b6763633f0e9548c630e235d896f2318 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 26 Oct 2020 17:54:24 +0100 Subject: [PATCH 1/2] Don't use Appveyor --- appveyor.yml | 64 ---------------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index cd349bb65..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,64 +0,0 @@ ---- -version: 2.11.0.dev.{build} - -os: Visual Studio 2019 -platform: x64 - -environment: - BITS: 64 - CMAKE_BUILD_TYPE: Debug - CMAKE_GENERATOR: "Visual Studio 16 2019" - CMAKE_GENERATOR_PLATFORM: x64 - # https://www.appveyor.com/docs/windows-images-software/#boost - BOOST_ROOT: 'C:\Libraries\boost_1_71_0' - BOOST_LIBRARYDIR: 'C:\Libraries\boost_1_71_0\lib64-msvc-14.2' - # https://www.appveyor.com/docs/windows-images-software/#tools - OPENSSL_ROOT_DIR: 'C:\OpenSSL-v111-Win64' - BISON_BINARY: 'C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_bison.exe' - FLEX_BINARY: 'C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_flex.exe' - -branches: - only: - - master - -cache: -- build -> appveyor.yml -- C:\ProgramData\chocolatey\lib\winflexbison3 - -install: -- ps: | - if (-not (Test-Path "C:\ProgramData\chocolatey\lib\winflexbison3")) { - & choco install winflexbison3 - if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - } - -# why that env handling, see -# https://help.appveyor.com/discussions/questions/18777-how-to-use-vcvars64bat-from-powershell#comment_44999171 -before_build: -- ps: | - & .\tools\win32\load-vsenv.ps1 - - & powershell.exe .\tools\win32\configure.ps1 - if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - - del build\Icinga*.msi - -build_script: -- ps: | - & powershell.exe .\tools\win32\build.ps1 - if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - -test_script: -- ps: | - & powershell.exe .\tools\win32\test.ps1 - if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - -# Disable until we really need them -# https://github.com/Icinga/icinga2/issues/6106 -# https://help.appveyor.com/discussions/problems/10253-maximum-allowed-artifact-storage-size-of-1000-mb-will-be-exceeded -#artifacts: -#- path: build/Icinga*.msi -#- path: build/choco/*.nupkg -#- path: build/Test.xml - -deploy: off From 14111de7e9e8d9c55c5b17f385a29e0af04b49c8 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 10 Nov 2020 18:34:00 +0100 Subject: [PATCH 2/2] GitHub actions: build Windows --- .github/workflows/packages.yml | 38 ++++++++++++++++++++++++++++++++++ doc/win-dev.ps1 | 26 ++++++++++++++++------- 2 files changed, 57 insertions(+), 7 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index bbd23e257..8156c010e 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -298,3 +298,41 @@ jobs: # -e ICINGA_BUILD_DEB_DEFAULT_ARCH=armhf \ # registry.icinga.com/build-docker/raspbian/${{ matrix.codename }} \ # icinga-build-test + windows: + name: Windows + + strategy: + fail-fast: false + matrix: + bits: [32, 64] + + runs-on: windows-latest + + env: + BITS: '${{ matrix.bits }}' + ICINGA_BUILD_TYPE: snapshot + UPSTREAM_GIT_URL: file://D:/a/icinga2/icinga2/.git + + steps: + - name: Checkout HEAD + uses: actions/checkout@v1 + + - name: windows-icinga2 + run: | + git clone https://git.icinga.com/packaging/windows-icinga2.git + + - name: Build tools + run: | + & .\doc\win-dev.ps1 + + - name: Source + run: | + git checkout -B master + cd windows-icinga2 + & .\source.ps1 + + - name: Binary + working-directory: windows-icinga2 + run: | + New-Item -ItemType Directory -Path 'C:\Program Files\Icinga2\WillBeRemoved' -ErrorAction SilentlyContinue + & .\build.ps1 diff --git a/doc/win-dev.ps1 b/doc/win-dev.ps1 index 37d6323b8..42a48d4f8 100644 --- a/doc/win-dev.ps1 +++ b/doc/win-dev.ps1 @@ -16,6 +16,14 @@ $MsvcVersion = '14.2' $BoostVersion = @(1, 71, 0) $OpensslVersion = '1_1_1h' +switch ($Env:BITS) { + 32 { } + 64 { } + default { + $Env:BITS = 64 + } +} + function Install-Exe { param ( @@ -47,13 +55,17 @@ function Install-Exe { } -Invoke-Expression (New-Object Net.WebClient).DownloadString('https://chocolatey.org/install.ps1') +try { + Get-Command choco +} catch { + Invoke-Expression (New-Object Net.WebClient).DownloadString('https://chocolatey.org/install.ps1') -$RegEnv = 'Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' -$ChocoPath = ";$(Join-Path $Env:AllUsersProfile chocolatey\bin)" + $RegEnv = 'Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' + $ChocoPath = ";$(Join-Path $Env:AllUsersProfile chocolatey\bin)" -Set-ItemProperty -Path $RegEnv -Name Path -Value ((Get-ItemProperty -Path $RegEnv -Name Path).Path + $ChocoPath) -$Env:Path += $ChocoPath + Set-ItemProperty -Path $RegEnv -Name Path -Value ((Get-ItemProperty -Path $RegEnv -Name Path).Path + $ChocoPath) + $Env:Path += $ChocoPath +} choco install -y "visualstudio${VsVersion}community" @@ -72,6 +84,6 @@ choco install -y windows-sdk-8.1 choco install -y wixtoolset -Install-Exe -Url "https://packages.icinga.com/windows/dependencies/boost_$($BoostVersion -join '_')-msvc-${MsvcVersion}-64.exe" -Dir "C:\local\boost_$($BoostVersion -join '_')-Win64" +Install-Exe -Url "https://packages.icinga.com/windows/dependencies/boost_$($BoostVersion -join '_')-msvc-${MsvcVersion}-${Env:BITS}.exe" -Dir "C:\local\boost_$($BoostVersion -join '_')-Win${Env:BITS}" -Install-Exe -Url "https://packages.icinga.com/windows/dependencies/Win64OpenSSL-${OpensslVersion}.exe" -Dir "C:\local\OpenSSL_${OpensslVersion}-Win64" +Install-Exe -Url "https://packages.icinga.com/windows/dependencies/Win${Env:BITS}OpenSSL-${OpensslVersion}.exe" -Dir "C:\local\OpenSSL_${OpensslVersion}-Win${Env:BITS}"