Skip to content

Fixed #748 support for nagios range based syntax in performance data #1

Fixed #748 support for nagios range based syntax in performance data

Fixed #748 support for nagios range based syntax in performance data #1

name: Build Legacy Windows version (xp)

Check failure on line 1 in .github/workflows/build-windows-legacy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-windows-legacy.yml

Invalid workflow file

(Line: 211, Col: 12): Unrecognized function: 'replace'. Located at position 1 within expression: replace(env.PYTHON_VERSION, '.', '')
permissions:
contents: read
on:
workflow_call:
inputs:
architecture:
type: string
description: 'Architecture to build'
required: true
default: 'x64'
version:
type: string
description: 'Version to build'
required: true
secrets:
AZURE_TENANT_ID:
description: 'Azure tenant ID'
required: true
AZURE_CLIENT_ID:
description: 'Azure client ID'
required: true
AZURE_CLIENT_SECRET:
description: 'Azure client secret'
required: true
env:
PYTHON_VERSION: 3.11
OPENSSL_VERSION: 3.5.4
PROTOBUF_VERSION: 21.12
BOOST_VERSION: 1.86.0
CRYPTOPP_VERSION: 8.9.0
LUA_VERSION: 5.4.8
TINY_XML_2_VERSION: 10.1.0
GOOGLE_TEST_VERSION: 1.12.1
MONGOOSE_VERSION: "7.20"
MINIZ_VERSION: "3.1.1"
jobs:
build:
runs-on: windows-latest
outputs:
platform: ${{ steps.setup.outputs.platform }}
steps:
- uses: actions/checkout@v6
- id: setup
run: |
if ("${{ inputs.architecture }}" -eq "x64") {
echo "msvc_arch=x64" >> $env:GITHUB_OUTPUT
echo "platform=x64" >> $env:GITHUB_OUTPUT
} else {
echo "msvc_arch=amd64_x86" >> $env:GITHUB_OUTPUT
echo "platform=Win32" >> $env:GITHUB_OUTPUT
}
shell: pwsh
- id: python
uses: actions/setup-python@v6
with:
python-version: ${{ ENV.PYTHON_VERSION }}
architecture: ${{ inputs.architecture }}
cache-dependency-path: 'build/python/requirements.txt'
cache: 'pip'
- uses: actions/setup-node@v6
with:
node-version: 20
cache: 'npm'
cache-dependency-path: web/package-lock.json
- id: build-web
working-directory: web
run: |
npm install
npm run build
- name: Install components
uses: ./.github/actions/update-msvc
- uses: ilammy/msvc-dev-cmd@v1
name: Setup msvc environment
with:
toolset: "14.1"
arch: ${{ steps.setup.outputs.msvc_arch }}
- name: make dirs
run: |
mkdir tmp
mkdir tmp\nscp
mkdir tmp\installer_lib
shell: cmd
- uses: shogo82148/actions-setup-perl@v1
with:
perl-version: 'latest'
distribution: strawberry
- name: setup python dependencies
run: |
& "$env:Python_ROOT_DIR\Scripts\pip" install -r build/python/requirements.txt
- id: google-test
uses: ./.github/actions/google-test
with:
version: ${{ env.GOOGLE_TEST_VERSION }}
architecture: ${{ inputs.architecture }}
runtime: 'static'
toolset: v141_xp
target_folder: './tmp/nscp'
- id: openssl
uses: ./.github/actions/openssl
with:
version: ${{ ENV.OPENSSL_VERSION }}
architecture: ${{ inputs.architecture }}
runtime: 'static'
- id: protobuf
uses: ./.github/actions/protobuf
with:
version: ${{ ENV.PROTOBUF_VERSION }}
architecture: ${{ inputs.architecture }}
runtime: static
toolset: v141_xp
support_xp: 'true'
- id: cryptopp
uses: ./.github/actions/cryptopp
with:
version: ${{ ENV.CRYPTOPP_VERSION }}
architecture: ${{ inputs.architecture }}
toolset: v141_xp
runtime: 'static'
- id: lua
uses: ./.github/actions/lua
with:
version: ${{ ENV.LUA_VERSION }}
- id: tinyxml2
uses: ./.github/actions/tinyxml2
with:
version: ${{ ENV.TINY_XML_2_VERSION }}
- id: mongoose
uses: ./.github/actions/mongoose
with:
version: ${{ ENV.MONGOOSE_VERSION }}
- id: miniz
uses: ./.github/actions/miniz
with:
version: ${{ ENV.MINIZ_VERSION }}
- name: Build Boost (static)
id: static_boost
uses: mickem/build-boost@42c59d10fc12f919a986f7e1c2f7c752d4960190
with:
version: ${{ ENV.BOOST_VERSION }}
libraries: system filesystem thread regex date_time program_options python chrono json
platform: ${{ inputs.architecture }}
configuration: Release
static: 1
static-runtime: 1
directory: ${{ runner.workspace }}/static_boost
toolset: msvc141
defines: _USING_V110_SDK71_ BOOST_USE_WINAPI_VERSION=0x501 BOOST_NO_CXX17_HDR_SHARED_MUTEX
- id: paths
run: |
$path_unix="${{ steps.static_boost.outputs.root }}".replace('\','/')
echo "static_boost_root=$path_unix" >> $env:GITHUB_OUTPUT
$path_unix="${{ steps.static_boost.outputs.librarydir }}".replace('\','/')
echo "static_boost_librarydir=$path_unix" >> $env:GITHUB_OUTPUT
$path_unix="${{ env.Python_ROOT_DIR }}".replace('\','/')
echo "python_path=$path_unix" >> $env:GITHUB_OUTPUT
shell: pwsh
- uses: DamianReeves/write-file-action@master
name: Write NSClient++ cmake config
with:
path: tmp/nscp/build.cmake
contents: |
set(Boost_USE_STATIC_RUNTIME ON)
set(Boost_USE_STATIC_LIBS ON)
SET(USE_STATIC_RUNTIME TRUE)
SET(NSCP_BOOST_PYTHON_VERSION "python311")
SET(LIBRARY_ROOT_FOLDER "${{ env.GITHUB_WORKSPACE }}")
SET(BOOST_ROOT "${{ steps.paths.outputs.static_boost_root }}")
SET(BOOST_LIBRARYDIR "${{ steps.paths.outputs.static_boost_librarydir }}")
SET(PROTOBUF_ROOT "${{ steps.protobuf.outputs.path_unix }}")
SET(PROTOBUF_LIBRARYDIR "${PROTOBUF_ROOT}/build/Release")
SET(OPENSSL_ROOT_DIR "${{ steps.openssl.outputs.path_unix }}")
SET(OPENSSL_USE_STATIC_LIBS TRUE)
SET(LUA_SOURCE_ROOT "${{ steps.lua.outputs.path_unix }}")
SET(Python3_ROOT_DIR "${{ steps.paths.outputs.python_path }}")
SET(Python3_FIND_STRATEGY LOCATION)
SET(CRYPTOPP_ROOT "${{ steps.cryptopp.outputs.path_unix }}")
SET(TINY_XML2_SOURCE_DIR "${{ steps.tinyxml2.outputs.path_unix }}")
set(GTEST_ROOT "${{ steps.google-test.outputs.path_unix }}")
set(MONGOOSE_SOURCE_DIR "${{ steps.mongoose.outputs.path_unix }}")
set(MINIZ_INCLUDE_DIR "${{ steps.miniz.outputs.path_unix }}")
set(CHECK_NSCLIENT_MISSING TRUE)
- name: Make python dist
working-directory: tmp/nscp
run: |
& "$env:Python_ROOT_DIR\python" ..\..\build\python\mk_pyzip.py --source ${{ env.Python_ROOT_DIR }} --version python${{ replace(env.PYTHON_VERSION, '.', '') }}
shell: pwsh
- name: CMake (installer_lib)
working-directory: tmp/installer_lib
run: |
cmake ../../installer_lib -T v141_xp -G "Visual Studio 17" -A ${{ steps.setup.outputs.platform }} -DBOOST_ROOT=${{ steps.paths.outputs.static_boost_root }} -DBOOST_LIBRARYDIR=${{ steps.paths.outputs.static_boost_librarydir }} -DOPENSSL_ROOT_DIR=${{ steps.openssl.outputs.path_unix }} -DBUILD_VERSION=${{ inputs.version }}
- name: Build installer_lib
working-directory: tmp/installer_lib
run: |
msbuild installer_lib.sln /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }}
- name: CMake (NSCP)
working-directory: tmp/nscp
run: |
cmake ../.. -T v141_xp -G "Visual Studio 17" -A ${{ steps.setup.outputs.platform }} -D BUILD_VERSION=${{ inputs.version }} -D CRT_MERGE_MODULE_NAME=Microsoft_VC143_CRT
- name: Build nsclient
working-directory: tmp/nscp
run: |
msbuild NSCP.sln /p:Configuration=RelWithDebInfo /p:Platform=${{ steps.setup.outputs.platform }}
- name: Run tests
working-directory: tmp/nscp
run: |
ctest --output-on-failure -C Release
- name: Sign binaries
if: github.actor != 'dependabot[bot]'
uses: ./.github/actions/sign-windows-binaries
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
- name: Build installer
working-directory: tmp/nscp
run: |
msbuild installers\installer-NSCP\installer_NSCP.vcxproj /p:Configuration=RelWithDebInfo /p:Platform=${{ steps.setup.outputs.platform }} /p:BuildProjectReferences=false
- name: Post process files
uses: ./.github/actions/post-process-windows-binaries
with:
version: ${{ inputs.version }}
platform: ${{ steps.setup.outputs.platform }}
suffix: '-legacy-xp'
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
signing-enabled: ${{ github.actor != 'dependabot[bot]' }}
- uses: actions/upload-artifact@v6
with:
name: NSCP-${{ inputs.version }}-${{ steps.setup.outputs.platform }}-legacy-xp
path: |
tmp/nscp/NSCP-${{ inputs.version }}-${{ steps.setup.outputs.platform }}-legacy-xp-docs.zip
tmp/nscp/NSCP-${{ inputs.version }}-${{ steps.setup.outputs.platform }}-legacy-xp.zip
tmp/nscp/installers/installer-NSCP/NSCP-${{ inputs.version }}-${{ steps.setup.outputs.platform }}-legacy-xp.msi
tmp/nscp/NSCP-${{ inputs.version }}-${{ inputs.platform }}-legacy-xp-symbols.zip
if-no-files-found: error
- name: Add versions
shell: bash
run: |
echo "| Library | Version |" >> $GITHUB_STEP_SUMMARY
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
echo "| Boost | ${{ env.BOOST_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| Cryptopp | ${{ env.CRYPTOPP_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| Lua | ${{ env.LUA_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| OpenSSL | ${{ env.OPENSSL_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| Protobuf | ${{ env.PROTOBUF_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| TinyXml2 | ${{ env.TINY_XML_2_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| Mongoose | ${{ env.MONGOOSE_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| Miniz | ${{ env.MINIZ_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| Python | ${{ env.PYTHON_VERSION }} |" >> $GITHUB_STEP_SUMMARY
integration-tests:
needs: build
uses: ./.github/workflows/integration-tests-windows.yml
with:
architecture: ${{ inputs.architecture }}
version: ${{ inputs.version }}
artifact-name: NSCP-${{ inputs.version }}-${{ needs.build.outputs.platform }}-legacy-xp
platform: ${{ needs.build.outputs.platform }}-legacy-xp