From 54761fc1597db4e965171125142ef384d769cf24 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Sun, 28 May 2023 09:41:02 +0200 Subject: [PATCH] Add Github CI - fix v4.3 build - added github CI action - remove appveyor.yml in favor of GH action Close #5 --- .github/dependabot.yml | 13 +++++ .github/workflows/CI_build.yml | 75 +++++++++++++++++++++++++++++ appveyor.yml | 87 ---------------------------------- 3 files changed, 88 insertions(+), 87 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/CI_build.yml delete mode 100644 appveyor.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..2d01d71 --- /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: "monthly" diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml new file mode 100644 index 0000000..d3699ad --- /dev/null +++ b/.github/workflows/CI_build.yml @@ -0,0 +1,75 @@ +name: CI_build + +on: [push, pull_request] + +jobs: + build: + + runs-on: windows-latest + strategy: + matrix: + build_configuration: [Release, Debug] + build_platform: [x64, Win32, ARM64] + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1 + + - name: MSBuild of plugin dll + working-directory: vs.proj\ + run: msbuild NppPluginDemo.vcxproj /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" + + - uses: olegtarasov/get-tag@v2.1.2 + id: tagName + + - name: zip artifacts for x64 + if: matrix.build_platform == 'x64' && matrix.build_configuration == 'Release' + run: | + Remove-Item bin64\*.ipdb + Remove-Item bin64\*.iobj + 7z a pluginDemo_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip .\bin64\* + + - name: Archive artifacts for x64 + if: matrix.build_platform == 'x64' && matrix.build_configuration == 'Release' + uses: actions/upload-artifact@v3 + with: + name: pluginDemo_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip + path: pluginDemo_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip + + - name: zip artifacts for Win32 + if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Release' + run: | + Remove-Item bin\*.ipdb + Remove-Item bin\*.iobj + 7z a pluginDemo_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip .\bin\* + + - name: Archive artifacts for Win32 + if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Release' + uses: actions/upload-artifact@v3 + with: + name: pluginDemo_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip + path: pluginDemo_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip + + - name: zip artifacts for ARM64 + if: matrix.build_platform == 'ARM64' && matrix.build_configuration == 'Release' + run: | + Remove-Item arm64\*.ipdb + Remove-Item arm64\*.iobj + 7z a pluginDemo_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip .\arm64\* + + - name: Archive artifacts for ARM64 + if: matrix.build_platform == 'ARM64' && matrix.build_configuration == 'Release' + uses: actions/upload-artifact@v3 + with: + name: pluginDemo_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip + path: pluginDemo_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip + + - name: Create release on tagging + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: pluginDemo_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip + diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index db6e00a..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,87 +0,0 @@ -version: 4.0.{build} -image: Visual Studio 2017 - - -environment: - matrix: - - PlatformToolset: v141 - -platform: - - x64 - - Win32 - - arm64 - -configuration: - - Release - - Debug - -install: - - if "%platform%"=="x64" set archi=amd64 - - if "%platform%"=="x64" set platform_input=x64 - - - if "%platform%"=="Win32" set archi=x86 - - if "%platform%"=="Win32" set platform_input=Win32 - - - if "%platform%"=="arm64" set archi=amd64_arm64 - - if "%platform%"=="arm64" set platform_input=arm64 - - - if "%PlatformToolset%"=="v141" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %archi% - - if "%PlatformToolset%"=="v142" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" %archi% - -build_script: - - cd "%APPVEYOR_BUILD_FOLDER%"/vs.proj - - msbuild NppPluginDemo.vcxproj /m /p:configuration="%configuration%" /p:platform="%platform_input%" /p:PlatformToolset="%PlatformToolset%" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - -after_build: - - cd "%APPVEYOR_BUILD_FOLDER%" - - ps: >- - - if ($env:PLATFORM_INPUT -eq "x64" -and $env:CONFIGURATION -eq "Release") { - Push-AppveyorArtifact "bin64\NppPluginDemo.dll" -FileName NppPluginDemo.dll - } - - if ($env:PLATFORM_INPUT -eq "Win32" -and $env:CONFIGURATION -eq "Release") { - Push-AppveyorArtifact "bin\NppPluginDemo.dll" -FileName NppPluginDemo.dll - } - - if ($env:PLATFORM_INPUT -eq "arm64" -and $env:CONFIGURATION -eq "Release") { - Push-AppveyorArtifact "arm64\NppPluginDemo.dll" -FileName NppPluginDemo.dll - } - - if ($($env:APPVEYOR_REPO_TAG) -eq "true" -and $env:CONFIGURATION -eq "Release" -and $env:PLATFORMTOOLSET -eq "v141") { - if($env:PLATFORM_INPUT -eq "x64"){ - $ZipFileName = "NppPluginDemo_$($env:APPVEYOR_REPO_TAG_NAME)_x64.zip" - Remove-Item bin64\*.ipdb - Remove-Item bin64\*.iobj - 7z a $ZipFileName "$($env:APPVEYOR_BUILD_FOLDER)\bin64\*" - } - if($env:PLATFORM_INPUT -eq "Win32"){ - $ZipFileName = "NppPluginDemo_$($env:APPVEYOR_REPO_TAG_NAME)_x86.zip" - Remove-Item bin\*.ipdb - Remove-Item bin\*.iobj - 7z a $ZipFileName "$($env:APPVEYOR_BUILD_FOLDER)\bin\*" - } - if($env:PLATFORM_INPUT -eq "arm64"){ - $ZipFileName = "NppPluginDemo_$($env:APPVEYOR_REPO_TAG_NAME)_arm64.zip" - Remove-Item bin64\*.ipdb - Remove-Item bin64\*.iobj - 7z a $ZipFileName "$($env:APPVEYOR_BUILD_FOLDER)\arm64\*" - } - } - -artifacts: - - path: NppPluginDemo_*.zip - name: releases - -deploy: - provider: GitHub - auth_token: - secure: !!TODO, see https://www.appveyor.com/docs/deployment/github/#provider-settings!! - artifact: releases - draft: false - prerelease: false - force_update: true - on: - appveyor_repo_tag: true - PlatformToolset: v141 - configuration: Release