Skip to content

Commit

Permalink
Working on the build workflow - 09/13/2023 04:24:17 UTC
Browse files Browse the repository at this point in the history
  • Loading branch information
Lateralus138 committed Sep 13, 2023
1 parent b1c0475 commit e4da4a6
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/main_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ jobs:
- uses: microsoft/[email protected]
- 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 }
43 changes: 43 additions & 0 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit e4da4a6

Please sign in to comment.