Skip to content

Commit

Permalink
Merge pull request #25 from vinsworldcom/actions
Browse files Browse the repository at this point in the history
Add GitHub Actions
  • Loading branch information
daddel80 authored Jun 28, 2023
2 parents b93c380 + 7690604 commit b43e2bf
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 11 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
43 changes: 43 additions & 0 deletions .github/workflows/CI_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI_build

on: [push, pull_request]

jobs:
build:

runs-on: windows-latest
strategy:
max-parallel: 6
matrix:
build_configuration: [Release, Debug]
build_platform: [x64, Win32, ARM64]

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1

- name: MSBuild of plugin dll
working-directory: .\vs.proj
run: msbuild NppMultiReplace.vcxproj /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v143" /target:zip
env:
ZIPCMD: 7z a -tzip

- name: Archive
uses: actions/upload-artifact@v3
with:
name: NppMultiReplace-${{ matrix.build_configuration }}-${{ matrix.build_platform }}
path: vs.proj\${{ matrix.build_configuration }}\${{ matrix.build_platform }}\NppMultiReplace.dll

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && matrix.build_configuration == 'Release'
with:
body: ${{ github.event.commits[0].message }}
files: vs.proj/${{ matrix.build_configuration }}/${{ matrix.build_platform }}/NppMultiReplace-v${{ github.ref_name }}-${{ matrix.build_platform }}.zip

- name: SHA256
if: startsWith(github.ref, 'refs/tags/') && matrix.build_configuration == 'Release'
run: sha256sum.exe vs.proj\${{ matrix.build_configuration }}\${{ matrix.build_platform }}\NppMultiReplace-v${{ github.ref_name }}-${{ matrix.build_platform }}.zip
35 changes: 25 additions & 10 deletions vs.proj/NppMultiReplace.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,27 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\bin\</OutDir>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\bin64\</OutDir>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\arm64\</OutDir>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand All @@ -149,6 +152,10 @@
<AdditionalDependencies>shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;ComCtl32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ImportLibrary>$(TargetName).lib</ImportLibrary>
</Link>
<PostBuildEvent>
<Command>copy ..\license.txt $(OutDir)license.txt
copy ..\README.md $(OutDir)README.md</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
Expand All @@ -164,6 +171,10 @@
<AdditionalDependencies>shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;ComCtl32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ImportLibrary>$(TargetName).lib</ImportLibrary>
</Link>
<PostBuildEvent>
<Command>copy ..\license.txt $(OutDir)license.txt
copy ..\README.md $(OutDir)README.md</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
Expand All @@ -179,6 +190,10 @@
<AdditionalDependencies>shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;ComCtl32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ImportLibrary>$(TargetName).lib</ImportLibrary>
</Link>
<PostBuildEvent>
<Command>copy ..\license.txt $(OutDir)license.txt
copy ..\README.md $(OutDir)README.md</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
Expand All @@ -199,8 +214,8 @@
<ImportLibrary>$(TargetName).lib</ImportLibrary>
</Link>
<PostBuildEvent>
<Command>copy ..\license.txt ..\bin\license.txt
copy ..\README.md ..\bin\README.md</Command>
<Command>copy ..\license.txt $(OutDir)license.txt
copy ..\README.md $(OutDir)README.md</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -222,8 +237,8 @@ copy ..\README.md ..\bin\README.md</Command>
<ImportLibrary>$(TargetName).lib</ImportLibrary>
</Link>
<PostBuildEvent>
<Command>copy ..\license.txt ..\bin64\license.txt
copy ..\README.md ..\bin64\README.md</Command>
<Command>copy ..\license.txt $(OutDir)license.txt
copy ..\README.md $(OutDir)README.md</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
Expand All @@ -245,11 +260,11 @@ copy ..\README.md ..\bin64\README.md</Command>
<ImportLibrary>$(TargetName).lib</ImportLibrary>
</Link>
<PostBuildEvent>
<Command>copy ..\license.txt ..\arm64\license.txt
copy ..\README.md ..\arm64\README.md</Command>
<Command>copy ..\license.txt $(OutDir)license.txt
copy ..\README.md $(OutDir)README.md</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
30 changes: 29 additions & 1 deletion vs.proj/NppMultiReplace.vcxproj.user
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />

<!--
Rename PROJECTNAME to the same as the *.vcxproj file in your project.
Or, import into that file by adding before the last closing tag:
<Import Project="PROJECTNAME.vcxproj.user"/>
Then, call with:
msbuild /target:zip
You can customize the ZIP program by setting the environment variable:
set ZIPCMD=zip
set ZIPCMD=7z a -tzip
-->

<Target Name="Zip" DependsOnTargets="Build">
<PropertyGroup>
<ZipCmd Condition="'$(ZIPCMD)' == ''">zip</ZipCmd>
</PropertyGroup>
<Exec Command="if not exist $(OutDir)$(TargetName) mkdir $(OutDir)$(TargetName)"/>
<Exec Command="copy $(OutDir)$(TargetName)$(TargetExt) $(OutDir)$(TargetName)"/>
<Exec Command="copy $(OutDir)license.txt $(OutDir)$(TargetName)"/>
<Exec Command="copy $(OutDir)README.md $(OutDir)$(TargetName)"/>
<Exec Command="for /f %%i in ('powershell -NoProfile -Command &quot;(Get-Item $(OutDir)$(TargetName)$(TargetExt)).VersionInfo.ProductVersion&quot;') do del $(OutDir)$(TargetName)-v%%i-$(Platform).zip"/>
<Exec Command="for /f %%i in ('powershell -NoProfile -Command &quot;(Get-Item $(OutDir)$(TargetName)$(TargetExt)).VersionInfo.ProductVersion&quot;') do cd $(OutDir)$(TargetName) %26%26 $(ZIPCMD) -r ..\$(TargetName)-v%%i-$(Platform).zip *"/>
</Target>
</Project>

0 comments on commit b43e2bf

Please sign in to comment.