From e4da4a68b70c1d2ac0c12afbaac495535d7e178e Mon Sep 17 00:00:00 2001 From: Lateralus138 Date: Tue, 12 Sep 2023 23:24:18 -0500 Subject: [PATCH] Working on the build workflow - 09/13/2023 04:24:17 UTC --- .github/workflows/main_build.yml | 14 ++++++----- scripts/build.ps1 | 43 ++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 scripts/build.ps1 diff --git a/.github/workflows/main_build.yml b/.github/workflows/main_build.yml index ba8bc8f..0de5544 100644 --- a/.github/workflows/main_build.yml +++ b/.github/workflows/main_build.yml @@ -25,9 +25,11 @@ jobs: - uses: microsoft/setup-msbuild@v1.3.1 - id: make_hosts_compress run: | - $cl = (Get-ChildItem -Path "$Env:ProgramW6432\Microsoft Visual Studio\" -Recurse -Filter "cl.exe").FullName | Select-String ".*x64\\x64.*" - $dev = (Get-ChildItem -Path "$Env:ProgramW6432\Microsoft Visual Studio\" -Recurse -Filter "vsdevcmd.bat").FullName - cd hostscompress || exit 255 - & $dev - & $cl[-1] /c /Ycpch.h /std:c++20 /W4 /EHsc pch.cpp - if (-Not (Test-Path -Path pch.pch)) { Exit 253 } + cd scripts + ./build.ps1 +# $cl = (Get-ChildItem -Path "$Env:ProgramW6432\Microsoft Visual Studio\" -Recurse -Filter "cl.exe").FullName | Select-String ".*x64\\x64.*" +# $dev = (Get-ChildItem -Path "$Env:ProgramW6432\Microsoft Visual Studio\" -Recurse -Filter "vsdevcmd.bat").FullName +# cd hostscompress || exit 255 +# & $dev +# & $cl[-1] /c /Ycpch.h /std:c++20 /W4 /EHsc pch.cpp +# if (-Not (Test-Path -Path pch.pch)) { Exit 253 } diff --git a/scripts/build.ps1 b/scripts/build.ps1 new file mode 100644 index 0000000..fa9c382 --- /dev/null +++ b/scripts/build.ps1 @@ -0,0 +1,43 @@ +$SCRIPTDIR = $PSScriptRoot +$PARENTDIR = (Get-Item $SCRIPTDIR ).parent.FullName +$WINDOWSDIR = "${PARENTDIR}\hostscompress" +$BUILDDIR = "$($PARENTDIR)\build\windows" +$BUILDDIR86 = "$($BUILDDIR)\x86" +$BUILDDIR64 = "$($BUILDDIR)\x64" +if (-Not (Test-Path "$($BUILDDIR)" -PathType Container)) +{ + New-Item "$($BUILDDIR)" -ItemType Directory + if (-Not (Test-Path "$($BUILDDIR)" -PathType Container)) + { + Exit 255 + } +} +if (-Not (Test-Path "$($BUILDDIR86)" -PathType Container)) +{ + New-Item "$($BUILDDIR86)" -ItemType Directory + if (-Not (Test-Path "$($BUILDDIR86)" -PathType Container)) + { + Exit 254 + } +} +if (-Not (Test-Path "$($BUILDDIR64)" -PathType Container)) +{ + New-Item "$($BUILDDIR64)" -ItemType Directory + if (-Not (Test-Path "$($BUILDDIR64)" -PathType Container)) + { + Exit 253 + } +} +Set-Location "$($WINDOWSDIR)" +MSBuild /p:Configuration=Release /p:Platform=x86 +if (-Not (Test-Path "$($WINDOWSDIR)\Release\hostscompress.exe" -PathType Leaf)) +{ + Exit 252 +} +Move-Item -Path "$($WINDOWSDIR)\Release\hostscompress.exe" "$($BUILDDIR86)\hostscompress-x86.exe" +MSBuild /p:Configuration=Release /p:Platform=x64 +if (-Not (Test-Path "$($WINDOWSDIR)\x64\Release\hostscompress.exe" -PathType Leaf)) +{ + Exit 251 +} +Move-Item -Path "$($WINDOWSDIR)\x64\Release\hostscompress.exe" "$($BUILDDIR64)\hostscompress-x64.exe"