Skip to content

Commit f71f61e

Browse files
committed
Implemented CI workflow
1 parent 0d21364 commit f71f61e

File tree

5 files changed

+170
-2
lines changed

5 files changed

+170
-2
lines changed

.github/workflows/Code-Mods.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Code Mods
2+
on:
3+
push:
4+
branches: [ main ]
5+
jobs:
6+
build:
7+
name: ${{matrix.configuration}}
8+
runs-on: windows-2025-vs2026
9+
strategy:
10+
matrix:
11+
configuration: [ Debug, Release ]
12+
steps:
13+
- name: Clone
14+
uses: actions/checkout@v6
15+
with:
16+
submodules: true
17+
- name: Install .NET
18+
uses: actions/setup-dotnet@v5
19+
with:
20+
dotnet-version: 10.0.x
21+
- name: Install Node
22+
uses: actions/setup-node@v6
23+
with:
24+
node-version: 24
25+
- name: Install artifact client
26+
uses: lhotari/gh-actions-artifact-client@v2
27+
- name: Build solutions
28+
working-directory: ${{github.workspace}}
29+
run: ./Build.ps1 -Archive -BlockedSolutions "Project '06" -Configuration "${{matrix.configuration}}" -Clean
30+
- name: Upload artifacts
31+
run: |
32+
foreach ($filePath in [System.IO.Directory]::EnumerateFiles("${{github.workspace}}/Artifacts/", "*.zip", [System.IO.SearchOption]::AllDirectories))
33+
{
34+
$gameName = [System.IO.Path]::GetFileName([System.IO.Path]::GetDirectoryName($filePath))
35+
$fileName = [System.IO.Path]::GetFileName($filePath)
36+
$artifactName = "[${gameName}] ${fileName}"
37+
38+
Write-Host "Uploading \"${artifactName}\"..."
39+
40+
Get-Content -AsByteStream "${filePath}" | node "${{runner.temp}}/_github_home/.local/bin/gh-actions-artifact-client.js" upload "${artifactName}"
41+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,6 @@ MigrationBackup/
347347

348348
# Ionide (cross platform F# VS Code tools) working folder
349349
.ionide/
350+
351+
# Build artifacts
352+
Artifacts/

Build.ps1

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
param
2+
(
3+
[Switch]$Archive,
4+
[String]$BlockedSolutions,
5+
[String]$Configuration = "Release",
6+
[Switch]$Clean,
7+
[Switch]$Help
8+
)
9+
10+
$work = $pwd
11+
$blockedSolutionsList = $BlockedSolutions.Split(";");
12+
$artifactsDir = [System.IO.Directory]::CreateDirectory([System.IO.Path]::Combine($work, "Artifacts"))
13+
14+
if ($Help)
15+
{
16+
Write-Host "Code Mods Build Script"
17+
Write-Host
18+
Write-Host "Parameters:"
19+
Write-Host "-Archive - archives the build artifacts."
20+
Write-Host "-BlockedSolutions - semi-colon separated list of solutions not to build."
21+
Write-Host "-Configuration [name] - build with a specific configuration."
22+
Write-Host "-Clean - clean the solutions before building."
23+
Write-Host "-Help - display help."
24+
exit
25+
}
26+
27+
$vs = ./Tools/vswhere.exe -nologo -latest -prerelease -property installationPath
28+
$vsCommonTools = [System.IO.Path]::Combine($vs, "Common7", "Tools")
29+
30+
pushd $vsCommonTools
31+
cmd /c "VsDevCmd.bat > nul 2> nul &set" |
32+
foreach {
33+
if ($_ -match "=") {
34+
$v = $_.split("=", 2)
35+
Set-Item -Force -Path "ENV:\$($v[0])" -Value "$($v[1])"
36+
}
37+
}
38+
popd
39+
40+
function GetProjectProperty([String]$in_projectPath, [String]$in_propertyName)
41+
{
42+
return & msbuild /NoLogo /p:Configuration="${Configuration}" -getProperty:"${in_propertyName}" "${in_projectPath}"
43+
}
44+
45+
function BuildSolutions([String]$in_root)
46+
{
47+
foreach ($solutionPath in [System.IO.Directory]::EnumerateFiles($in_root, "*.sln", [System.IO.SearchOption]::AllDirectories))
48+
{
49+
$solutionDir = Split-Path $solutionPath
50+
$solutionName = [System.IO.Path]::GetFileNameWithoutExtension($solutionPath)
51+
52+
if ($blockedSolutionsList.Contains($solutionName))
53+
{
54+
continue
55+
}
56+
57+
$target = "Build"
58+
59+
if ($Clean)
60+
{
61+
$target = "Clean;" + $target
62+
}
63+
64+
Write-Host
65+
Write-Host ("**************" + '*' * $solutionPath.Length) -ForegroundColor DarkGreen
66+
Write-Host "* Solution: ${solutionPath} *" -ForegroundColor DarkGreen
67+
Write-Host ("**************" + '*' * $solutionPath.Length) -ForegroundColor DarkGreen
68+
69+
& msbuild /NoLogo /v:m /t:"${target}" /Restore /p:RestorePackagesConfig=true /p:Configuration="${Configuration}" "${solutionPath}"
70+
71+
if ($Archive)
72+
{
73+
$projects = dotnet sln "${solutionPath}" list |
74+
Select-Object -Skip 2 |
75+
ForEach-Object {
76+
Join-Path $solutionDir $_.Trim()
77+
}
78+
79+
foreach ($projectPath in $projects)
80+
{
81+
$projectDir = GetProjectProperty $projectPath "ProjectDir"
82+
$projectName = GetProjectProperty $projectPath "ProjectName"
83+
$binDir = [System.IO.Path]::Combine($projectDir, "bin")
84+
85+
foreach ($platformDir in [System.IO.Directory]::EnumerateDirectories($binDir, "*"))
86+
{
87+
$platformName = [System.IO.Path]::GetFileName($platformDir)
88+
89+
if ($platformName -eq $Configuration)
90+
{
91+
# Required for some .NET projects.
92+
$targetDir = $platformDir
93+
$targetName = "${projectName}-${Configuration}.zip"
94+
}
95+
else
96+
{
97+
$targetDir = [System.IO.Path]::Combine($platformDir, $Configuration)
98+
$targetName = "${projectName}-${platformName}-${Configuration}.zip"
99+
}
100+
101+
if (![System.IO.Directory]::Exists($targetDir))
102+
{
103+
Write-Host
104+
Write-Host ("***********************" + '*' * $targetDir.Length) -ForegroundColor DarkRed
105+
Write-Host "* Cannot archive project binaries." -ForegroundColor DarkRed
106+
Write-Host "* Directory not found: ${targetDir}" -ForegroundColor DarkRed
107+
Write-Host ("***********************" + '*' * $targetDir.Length) -ForegroundColor DarkRed
108+
109+
exit -1
110+
}
111+
112+
$solutionArtifactsDir = [System.IO.Directory]::CreateDirectory([System.IO.Path]::Combine($artifactsDir.FullName, $solutionName))
113+
$projectArtifactPath = [System.IO.Path]::Combine($solutionArtifactsDir.FullName, $targetName)
114+
115+
cd $targetDir
116+
Compress-Archive -Force * $projectArtifactPath
117+
cd $work
118+
}
119+
}
120+
}
121+
}
122+
}
123+
124+
BuildSolutions("${work}/Games/")

Games/Yakuza/FixAnalogDeadzone/DllMain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ DECLARE_HOOK(void, __fastcall, ProcessInputs, Sig_ProcessInputs(), void* a1, voi
1313
original_ProcessInputs(a1, a2, a3);
1414
}
1515

16-
DECLARE_HOOK(bool, __fastcall, IsKeyDown, Sig_IsKeyDown(), uint32_t keyCode)
16+
DECLARE_HOOK(bool, __fastcall, IsKeyDown, Sig_IsKeyDown(), uint32_t in_keyCode)
1717
{
18-
auto result = original_IsKeyDown(keyCode);
18+
auto result = original_IsKeyDown(in_keyCode);
1919

2020
// Use keyboard deadzone.
2121
if (result && g_pAnalogDeadzone)

Tools/vswhere.exe

458 KB
Binary file not shown.

0 commit comments

Comments
 (0)