Skip to content

Commit

Permalink
Update template. Bump SWPSDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
sawich committed Sep 14, 2024
1 parent 0e22edd commit a5f621e
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 41 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
32 changes: 0 additions & 32 deletions .github/workflows/test-build.yml

This file was deleted.

11 changes: 11 additions & 0 deletions swp-template.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ 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
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -43,6 +50,10 @@ Global
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
Expand Down
12 changes: 4 additions & 8 deletions swp-template/project/swp-template.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,22 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)output\</OutDir>
<OutDir>$(SolutionDir)bin\$(Configuration)\swp\plugins\$(ProjectName)\</OutDir>
<IntDir>$(SolutionDir).tmp\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)output\</OutDir>
<OutDir>$(SolutionDir)bin\$(Configuration)\swp\plugins\$(ProjectName)\</OutDir>
<IntDir>$(SolutionDir).tmp\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)output\</OutDir>
<OutDir>$(SolutionDir)bin\$(Configuration)\swp\plugins\$(ProjectName)\</OutDir>
<IntDir>$(SolutionDir).tmp\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)output\</OutDir>
<OutDir>$(SolutionDir)bin\$(Configuration)\swp\plugins\$(ProjectName)\</OutDir>
<IntDir>$(SolutionDir).tmp\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Label="Vcpkg">
Expand Down Expand Up @@ -124,7 +124,6 @@
<PreprocessorDefinitions>WIN32;_DEBUG;SWPTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<AdditionalIncludeDirectories>$(SolutionDir)swp-sdk\swp-sdk\headers;$(ProjectDir)..\headers\</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PrecompiledHeader>Use</PrecompiledHeader>
Expand All @@ -148,7 +147,6 @@
<PreprocessorDefinitions>WIN32;NDEBUG;SWPTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<AdditionalIncludeDirectories>$(SolutionDir)swp-sdk\swp-sdk\headers;$(ProjectDir)..\headers\</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PrecompiledHeader>Use</PrecompiledHeader>
Expand All @@ -172,7 +170,6 @@
<PreprocessorDefinitions>_DEBUG;SWPTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<AdditionalIncludeDirectories>$(SolutionDir)swp-sdk\swp-sdk\headers;$(ProjectDir)..\headers\</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PrecompiledHeader>Use</PrecompiledHeader>
Expand All @@ -196,7 +193,6 @@
<PreprocessorDefinitions>NDEBUG;SWPTEMPLATE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<AdditionalIncludeDirectories>$(SolutionDir)swp-sdk\swp-sdk\headers;$(ProjectDir)..\headers\</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PrecompiledHeader>Use</PrecompiledHeader>
Expand Down

0 comments on commit a5f621e

Please sign in to comment.