From 66c265691b522452bc91c9a01232bd9278d5d9c0 Mon Sep 17 00:00:00 2001 From: chcg Date: Sat, 1 Apr 2023 23:50:24 +0200 Subject: [PATCH] adapt CI build to new cmake build (#10) --- .github/dependabot.yml | 13 ++++++++ .github/workflows/CI_build.yml | 56 +++++++++++++++++++++------------- appveyor.yml | 20 ++++++------ 3 files changed, 56 insertions(+), 33 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..469c6f7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index f71b3cf..64e9716 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -5,34 +5,46 @@ on: [push, pull_request] jobs: build: - runs-on: windows-2019 + runs-on: windows-latest strategy: - max-parallel: 4 + fail-fast: false matrix: - build_configuration: [Unicode Release, Unicode Debug] - build_platform: [x64, Win32] - + include: + - build_configuration: RelWithDebInfo + build_platform: x64 + build_platform_vcpkg: x64 + - build_configuration: Debug + build_platform: x64 + build_platform_vcpkg: x64 + - build_configuration: RelWithDebInfo + build_platform: Win32 + build_platform_vcpkg: x86 + - build_configuration: Debug + build_platform: Win32 + build_platform_vcpkg: x86 + steps: - name: Checkout repo - uses: actions/checkout@v1 + uses: actions/checkout@v3 - - name: Setup to add MSBuild.exe to path - uses: warrenbuckley/Setup-MSBuild@v1 + - name: Restore vcpkg packages + working-directory: ${{env.GITHUB_WORKSPACE}} + run: vcpkg integrate install - - name: MSBuild of plugin dll - working-directory: src\NppBplistPlugin\ - run: msbuild NppBplistPlugin.sln /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v142" + - name: generate cmake + run: | + mkdir _build + cd _build + cmake -G "Visual Studio 17 2022" -A ${{ matrix.build_platform }} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ matrix.build_platform_vcpkg }}-windows-static .. - - name: Archive artifacts for x64 - if: matrix.build_platform == 'x64' - uses: actions/upload-artifact@v1 - with: - name: plugin_dll_x64 - path: src\NppBplistPlugin\${{ matrix.build_platform }}\${{ matrix.build_configuration }}\NppBplistPlugin.dll + - name: build cmake + run: | + cd _build + cmake --build . --config ${{ matrix.build_configuration }} - - name: Archive artifacts for Win32 - if: matrix.build_platform == 'Win32' - uses: actions/upload-artifact@v1 + - name: Archive artifacts for ${{ matrix.build_platform }} + if: matrix.build_configuration == 'RelWithDebInfo' + uses: actions/upload-artifact@v3 with: - name: plugin_dll_x86 - path: src\NppBplistPlugin\src\${{ matrix.build_configuration }}\NppBplistPlugin.dll + name: plugin_dll_${{ matrix.build_platform }} + path: bin\${{ matrix.build_configuration }}\NppBplistPlugin.dll diff --git a/appveyor.yml b/appveyor.yml index 6efe856..9ed2d70 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.3.0.{build} +version: 2.0.0.{build} image: Visual Studio 2022 @@ -31,31 +31,29 @@ install: build_script: - echo %vcpkg_triplet_arch% - - cmake . -B"build" -G "Visual Studio 17 2022" -A %platform% -DCMAKE_TOOLCHAIN_FILE=C:\Tools\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=%vcpkg_triplet_arch%-windows-static -DVCPKG_OVERLAY_TRIPLETS=./vcpkg/triplets + - cmake . -B"build" -G "Visual Studio 17 2022" -A %platform_input% -DCMAKE_TOOLCHAIN_FILE=C:\Tools\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=%vcpkg_triplet_arch%-windows-static -DVCPKG_OVERLAY_TRIPLETS=./vcpkg/triplets - cmake --build "build" --config RelWithDebInfo after_build: - - cd "%APPVEYOR_BUILD_FOLDER%"/bin - - dir RelWithDebInfo - - dir $env:PLATFORM_INPUT\$env:CONFIGURATION\ + - cd "%APPVEYOR_BUILD_FOLDER%" - ps: >- if ($env:PLATFORM_INPUT -eq "x64") { - #Push-AppveyorArtifact "$env:PLATFORM_INPUT\$env:CONFIGURATION\NppBplistPlugin.dll" -FileName NppBplistPlugin.dll + Push-AppveyorArtifact "bin\$env:CONFIGURATION\NppBplistPlugin.dll" -FileName NppBplistPlugin.dll } if ($env:PLATFORM_INPUT -eq "Win32" ) { - #Push-AppveyorArtifact "src\$env:CONFIGURATION\NppBplistPlugin.dll" -FileName NppBplistPlugin.dll + Push-AppveyorArtifact "bin\$env:CONFIGURATION\NppBplistPlugin.dll" -FileName NppBplistPlugin.dll } if ($($env:APPVEYOR_REPO_TAG) -eq "true" -and $env:PLATFORMTOOLSET -eq "%PlatformToolset%") { if($env:PLATFORM_INPUT -eq "x64"){ - $ZipFileName = "NppBplistPlugin_$($env:APPVEYOR_REPO_TAG_NAME)_x64.zip" - 7z a $ZipFileName $env:PLATFORM_INPUT\$env:CONFIGURATION\NppBplistPlugin.dll + $ZipFileName = "NppBplistPlugin_$($env:APPVEYOR_REPO_TAG_NAME)_x64.zip" + 7z a $ZipFileName bin\$env:CONFIGURATION\NppBplistPlugin.dll } if($env:PLATFORM_INPUT -eq "Win32"){ - $ZipFileName = "NppBplistPlugin_$($env:APPVEYOR_REPO_TAG_NAME)_x86.zip" - 7z a $ZipFileName src\$env:CONFIGURATION\NppBplistPlugin.dll + $ZipFileName = "NppBplistPlugin_$($env:APPVEYOR_REPO_TAG_NAME)_x86.zip" + 7z a $ZipFileName bin\$env:CONFIGURATION\NppBplistPlugin.dll } }