From 1cc6f7d1a8e64cba0fc468bff3490401709d69fc Mon Sep 17 00:00:00 2001 From: sawich Date: Sat, 14 Sep 2024 23:31:00 +0300 Subject: [PATCH] Update template. Bump SWPSDK. --- .github/workflows/ci.yml | 86 ++++ .github/workflows/test-build.yml | 32 -- swp-sdk | 2 +- swp-template.sln | 31 +- .../windows}/swp-template.vcxproj | 464 +++++++++--------- .../windows}/swp-template.vcxproj.filters | 71 +-- vcpkg.json | 2 +- 7 files changed, 377 insertions(+), 311 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/test-build.yml rename swp-template/{project => projects/windows}/swp-template.vcxproj (74%) rename swp-template/{project => projects/windows}/swp-template.vcxproj.filters (71%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c228b88 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,86 @@ +name: "Continuous Integration" + +on: [push] + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + VCPKG_FEATURE_FLAGS: "dependencygraph" + +permissions: + contents: "write" + +jobs: + publish: + runs-on: "windows-latest" + strategy: + fail-fast: true + matrix: + build-config: ["Debug", "Release"] + arch: ["x64", "x86"] + path: ["swp/**/*.dll swp/**/*.pdb", "swp/**/*.dll"] + + env: + ARCHIVE_NAME: ${{ github.event.repository.name }}-${{ github.ref_name }}-${{ matrix.build-config }}-${{ matrix.arch }}${{ contains(matrix.path, '.pdb') && '-WithDebugSymbols' || '' }}.zip + + name: "Build a ${{ matrix.build-config }} (${{ matrix.arch }} | ${{ matrix.path }}) version" + steps: + - name: "Export GitHub Actions cache environment variables" + uses: "actions/github-script@main" + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: "Print Archive name" + run: | + echo ${{ env.ARCHIVE_NAME }} + + - id: "variables" + name: "Generate Variables" + run: | + $name = ("${{ github.event.repository.name }}".Substring(4) -split '-') | ForEach-Object { $_.Substring(0, 1).ToUpper() + $_.Substring(1).ToLower() } | Join-String -Separator ' '; + echo "name=$name" >> $env:GITHUB_OUTPUT + + if ("${{ github.ref_name }}" -match '^v[0-9]+.[0-9]+.[0-9]+$') { + echo "is_test=false" >> $env:GITHUB_OUTPUT + } else { + echo "is_test=true" >> $env:GITHUB_OUTPUT + } + + - name: "Release name" + run: 'echo "Release name: ${{ steps.variables.outputs.name }}"' + + - name: "Is Test?" + run: 'echo "Test status: ${{ steps.variables.outputs.is_test }}"' + + - name: "Checkout" + uses: "actions/checkout@main" + with: + submodules: true + + - name: "Add MSBuild to PATH" + uses: "microsoft/setup-msbuild@main" + with: + vs-prerelease: true + + - name: "Integrate vcpkg" + run: "vcpkg integrate install" + + - name: "Build solution" + run: "msbuild /m /p:Configuration=${{ matrix.build-config }} /property:Platform=${{ matrix.arch }}" + + - name: "Pack to archive" + run: | + cd bin/${{ matrix.build-config }} + 7z -r a ../../${{ env.ARCHIVE_NAME }} ${{ matrix.path }} + 7z l ../../${{ env.ARCHIVE_NAME }} + + - name: "Publish build" + uses: "softprops/action-gh-release@master" + if: ${{ steps.variables.outputs.is_test == 'false' }} + with: + name: "SoulWorkerPlugin ${{ steps.variables.outputs.name }} ${{ github.ref_name }}" + files: ${{ env.ARCHIVE_NAME }} + generate_release_notes: true + tag_name: "${{ github.ref_name }}" \ No newline at end of file diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml deleted file mode 100644 index db5c611..0000000 --- a/.github/workflows/test-build.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Test Build - -on: - push: - branches-ignore: - - main - -jobs: - publish: - runs-on: windows-latest - strategy: - fail-fast: true - matrix: - include: - - BUILD_CONFIGURATION: Debug - - BUILD_CONFIGURATION: Release - - name: ${{ matrix.BUILD_CONFIGURATION }} - steps: - - name: Checkout - uses: actions/checkout@main - with: - submodules: true - - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@main - - - name: Integrate vcpkg - run: vcpkg integrate install - - - name: Build solution - run: msbuild /m /p:Configuration=${{ matrix.BUILD_CONFIGURATION }} /property:Platform=x86 \ No newline at end of file diff --git a/swp-sdk b/swp-sdk index bd1a397..bc696bd 160000 --- a/swp-sdk +++ b/swp-sdk @@ -1 +1 @@ -Subproject commit bd1a3971863cc7dfdb0ba0621e89cf8e4ffc80a6 +Subproject commit bc696bd33da76ee6a253f57684e4e2fe8b347e91 diff --git a/swp-template.sln b/swp-template.sln index b562c35..69fe840 100644 --- a/swp-template.sln +++ b/swp-template.sln @@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.1.32104.313 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "swp-template", "swp-template\project\swp-template.vcxproj", "{46B22A81-4972-4D6B-8EC9-91EF44B30095}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{51AF7FAB-6B50-4829-B826-FE71498E3674}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore @@ -15,6 +13,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "swp-sdk", "swp-sdk\swp-sdk\projects\windows\swp-sdk.vcxproj", "{FAF6A873-FC74-4CF9-9767-07B6513B9CCD}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{1F3DF414-6135-462D-85B5-DC199EF6DAFC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{DE1F8123-BF9A-4D1A-819A-B9B5963BE113}" + ProjectSection(SolutionItems) = preProject + .github\workflows\ci.yml = .github\workflows\ci.yml + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "swp-template", "swp-template\projects\windows\swp-template.vcxproj", "{46B22A81-4972-4D6B-8EC9-91EF44B30095}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -23,14 +30,6 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Debug|x64.ActiveCfg = Debug|x64 - {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Debug|x64.Build.0 = Debug|x64 - {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Debug|x86.ActiveCfg = Debug|Win32 - {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Debug|x86.Build.0 = Debug|Win32 - {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Release|x64.ActiveCfg = Release|x64 - {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Release|x64.Build.0 = Release|x64 - {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Release|x86.ActiveCfg = Release|Win32 - {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Release|x86.Build.0 = Release|Win32 {FAF6A873-FC74-4CF9-9767-07B6513B9CCD}.Debug|x64.ActiveCfg = Debug|x64 {FAF6A873-FC74-4CF9-9767-07B6513B9CCD}.Debug|x64.Build.0 = Debug|x64 {FAF6A873-FC74-4CF9-9767-07B6513B9CCD}.Debug|x86.ActiveCfg = Debug|Win32 @@ -39,10 +38,22 @@ Global {FAF6A873-FC74-4CF9-9767-07B6513B9CCD}.Release|x64.Build.0 = Release|x64 {FAF6A873-FC74-4CF9-9767-07B6513B9CCD}.Release|x86.ActiveCfg = Release|Win32 {FAF6A873-FC74-4CF9-9767-07B6513B9CCD}.Release|x86.Build.0 = Release|Win32 + {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Debug|x64.ActiveCfg = Debug|x64 + {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Debug|x64.Build.0 = Debug|x64 + {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Debug|x86.ActiveCfg = Debug|Win32 + {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Debug|x86.Build.0 = Debug|Win32 + {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Release|x64.ActiveCfg = Release|x64 + {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Release|x64.Build.0 = Release|x64 + {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Release|x86.ActiveCfg = Release|Win32 + {46B22A81-4972-4D6B-8EC9-91EF44B30095}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {1F3DF414-6135-462D-85B5-DC199EF6DAFC} = {51AF7FAB-6B50-4829-B826-FE71498E3674} + {DE1F8123-BF9A-4D1A-819A-B9B5963BE113} = {1F3DF414-6135-462D-85B5-DC199EF6DAFC} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {228D6202-B35F-4215-9B8D-5B0AF4E654ED} EndGlobalSection diff --git a/swp-template/project/swp-template.vcxproj b/swp-template/projects/windows/swp-template.vcxproj similarity index 74% rename from swp-template/project/swp-template.vcxproj rename to swp-template/projects/windows/swp-template.vcxproj index 6f15339..fbc93d9 100644 --- a/swp-template/project/swp-template.vcxproj +++ b/swp-template/projects/windows/swp-template.vcxproj @@ -1,233 +1,233 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {46b22a81-4972-4d6b-8ec9-91ef44b30095} - swptemplate - 10.0 - - - - DynamicLibrary - true - v143 - Unicode - x86 - true - - - DynamicLibrary - false - v143 - true - Unicode - x86 - true - - - DynamicLibrary - true - v143 - Unicode - x86 - true - - - DynamicLibrary - false - v143 - true - Unicode - x86 - true - - - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)output\ - $(SolutionDir).tmp\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)output\ - $(SolutionDir).tmp\$(Configuration)\$(ProjectName)\ - - - true - $(SolutionDir)output\ - $(SolutionDir).tmp\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)output\ - $(SolutionDir).tmp\$(Configuration)\$(ProjectName)\ - - - true - - - true - true - - - true - true - - - true - true - - - true - true - - - - Level3 - true - WIN32;_DEBUG;SWPTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - stdcpplatest - stdc17 - $(SolutionDir)swp-sdk\swp-sdk\headers;$(ProjectDir)..\headers\ - true - Use - pch.hpp - %(PrecompiledHeaderFile) - false - false - - - Windows - true - false - - - - - Level3 - true - true - true - WIN32;NDEBUG;SWPTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - stdcpplatest - stdc17 - $(SolutionDir)swp-sdk\swp-sdk\headers;$(ProjectDir)..\headers\ - true - Use - pch.hpp - %(PrecompiledHeaderFile) - false - false - - - Windows - true - true - true - false - - - - - Level3 - true - _DEBUG;SWPTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - stdcpplatest - stdc17 - $(SolutionDir)swp-sdk\swp-sdk\headers;$(ProjectDir)..\headers\ - true - Use - pch.hpp - %(PrecompiledHeaderFile) - false - false - - - Windows - true - false - - - - - Level3 - true - true - true - NDEBUG;SWPTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - stdcpplatest - stdc17 - $(SolutionDir)swp-sdk\swp-sdk\headers;$(ProjectDir)..\headers\ - true - Use - pch.hpp - %(PrecompiledHeaderFile) - false - false - - - Windows - true - true - true - false - - - - - - - - - - Create - Create - Create - Create - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {46b22a81-4972-4d6b-8ec9-91ef44b30095} + swptemplate + 10.0 + + + + DynamicLibrary + true + v143 + Unicode + x86 + true + + + DynamicLibrary + false + v143 + true + Unicode + x86 + true + + + DynamicLibrary + true + v143 + Unicode + x86 + true + + + DynamicLibrary + false + v143 + true + Unicode + x86 + true + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)bin\$(Configuration)\swp\plugins\$(ProjectName)\ + $(SolutionDir).tmp\$(Configuration)\$(ProjectName)\ + + + false + $(SolutionDir)bin\$(Configuration)\swp\plugins\$(ProjectName)\ + $(SolutionDir).tmp\$(Configuration)\$(ProjectName)\ + + + true + $(SolutionDir)bin\$(Configuration)\swp\plugins\$(ProjectName)\ + $(SolutionDir).tmp\$(Configuration)\$(ProjectName)\ + + + false + $(SolutionDir)bin\$(Configuration)\swp\plugins\$(ProjectName)\ + $(SolutionDir).tmp\$(Configuration)\$(ProjectName)\ + + + true + + + + Level3 + true + + WIN32;_DEBUG;SWPTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + stdcpplatest + + $(SolutionDir)swp-sdk\swp-sdk\headers;$(ProjectDir)..\..\headers\ + true + Use + pch.hpp + %(PrecompiledHeaderFile) + false + false + /utf-8 %(AdditionalOptions) + + + Windows + true + false + + + + + Level3 + true + true + true + + WIN32;NDEBUG;SWPTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + stdcpplatest + + $(SolutionDir)swp-sdk\swp-sdk\headers;$(ProjectDir)..\..\headers\ + true + Use + pch.hpp + %(PrecompiledHeaderFile) + false + false + /utf-8 %(AdditionalOptions) + + + Windows + true + true + true + false + + + + + Level3 + true + + _DEBUG;SWPTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + stdcpplatest + + $(SolutionDir)swp-sdk\swp-sdk\headers;$(ProjectDir)..\..\headers\ + true + Use + pch.hpp + %(PrecompiledHeaderFile) + false + false + /utf-8 %(AdditionalOptions) + + + Windows + true + false + + + + + Level3 + true + true + true + + NDEBUG;SWPTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + stdcpplatest + + $(SolutionDir)swp-sdk\swp-sdk\headers;$(ProjectDir)..\..\headers\ + true + Use + pch.hpp + %(PrecompiledHeaderFile) + false + false + /utf-8 %(AdditionalOptions) + + + Windows + true + true + true + false + + + + + + + + + + Create + Create + Create + Create + + + + + + \ No newline at end of file diff --git a/swp-template/project/swp-template.vcxproj.filters b/swp-template/projects/windows/swp-template.vcxproj.filters similarity index 71% rename from swp-template/project/swp-template.vcxproj.filters rename to swp-template/projects/windows/swp-template.vcxproj.filters index 98c026f..8581e8c 100644 --- a/swp-template/project/swp-template.vcxproj.filters +++ b/swp-template/projects/windows/swp-template.vcxproj.filters @@ -1,36 +1,37 @@ - - - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - - - headers - - - headers - - - - - sources - - - sources - - - sources - - + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + + + headers + + + headers + + + + + sources + + + sources + + + sources + + \ No newline at end of file diff --git a/vcpkg.json b/vcpkg.json index 592de33..3da6382 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,5 +1,5 @@ { "name": "swp-template", "version": "1.0.0", - "dependencies": [ "spdlog", "neargye-semver" ] + "dependencies": [ "spdlog", "detours" ] }