Skip to content

Commit 7500d75

Browse files
committed
Implemented CI workflow
1 parent 0d21364 commit 7500d75

5 files changed

Lines changed: 172 additions & 2 deletions

File tree

.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: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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+
$root = [System.IO.Path]::Combine($work, $in_root)
48+
49+
foreach ($solutionPath in [System.IO.Directory]::EnumerateFiles($root, "*.sln", [System.IO.SearchOption]::AllDirectories))
50+
{
51+
$solutionDir = Split-Path $solutionPath
52+
$solutionName = [System.IO.Path]::GetFileNameWithoutExtension($solutionPath)
53+
54+
if ($blockedSolutionsList.Contains($solutionName))
55+
{
56+
continue
57+
}
58+
59+
$target = "Build"
60+
61+
if ($Clean)
62+
{
63+
$target = "Clean;" + $target
64+
}
65+
66+
Write-Host
67+
Write-Host ("**************" + '*' * $solutionPath.Length) -ForegroundColor DarkGreen
68+
Write-Host "* Solution: ${solutionPath} *" -ForegroundColor DarkGreen
69+
Write-Host ("**************" + '*' * $solutionPath.Length) -ForegroundColor DarkGreen
70+
71+
& msbuild /NoLogo /v:m /t:"${target}" /Restore /p:RestorePackagesConfig=true /p:Configuration="${Configuration}" "${solutionPath}"
72+
73+
if ($Archive)
74+
{
75+
$projects = dotnet sln "${solutionPath}" list |
76+
Select-Object -Skip 2 |
77+
ForEach-Object {
78+
Join-Path $solutionDir $_.Trim()
79+
}
80+
81+
foreach ($projectPath in $projects)
82+
{
83+
$projectDir = GetProjectProperty $projectPath "ProjectDir"
84+
$projectName = GetProjectProperty $projectPath "ProjectName"
85+
$binDir = [System.IO.Path]::Combine($projectDir, "bin")
86+
87+
foreach ($platformDir in [System.IO.Directory]::EnumerateDirectories($binDir, "*"))
88+
{
89+
$platformName = [System.IO.Path]::GetFileName($platformDir)
90+
91+
if ($platformName -eq $Configuration)
92+
{
93+
# Required for some .NET projects.
94+
$targetDir = $platformDir
95+
$targetName = "${projectName}-${Configuration}.zip"
96+
}
97+
else
98+
{
99+
$targetDir = [System.IO.Path]::Combine($platformDir, $Configuration)
100+
$targetName = "${projectName}-${platformName}-${Configuration}.zip"
101+
}
102+
103+
if (![System.IO.Directory]::Exists($targetDir))
104+
{
105+
Write-Host
106+
Write-Host ("***********************" + '*' * $targetDir.Length) -ForegroundColor DarkRed
107+
Write-Host "* Cannot archive project binaries." -ForegroundColor DarkRed
108+
Write-Host "* Directory not found: ${targetDir}" -ForegroundColor DarkRed
109+
Write-Host ("***********************" + '*' * $targetDir.Length) -ForegroundColor DarkRed
110+
111+
exit -1
112+
}
113+
114+
$artifactRootDir = [System.IO.Directory]::CreateDirectory([System.IO.Path]::Combine($artifactsDir.FullName, $in_root, $solutionName))
115+
$artifactTargetPath = [System.IO.Path]::Combine($artifactRootDir.FullName, $targetName)
116+
117+
cd $targetDir
118+
Compress-Archive -Force * $artifactTargetPath
119+
cd $work
120+
}
121+
}
122+
}
123+
}
124+
}
125+
126+
BuildSolutions("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)