Skip to content

Commit ab1b418

Browse files
committed
Refactor deploy workflow to improve environment setup and enhance RMLevelLoaderGen execution clarity
1 parent 75ac47f commit ab1b418

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@ jobs:
1313
- name: Checkout Main Repo
1414
uses: actions/checkout@v4
1515

16-
# Needed to compile the missing exe
17-
- name: Setup Dotnet
16+
# --- SETUP ENVIRONMENTS ---
17+
- name: Setup Dotnet (For compiling the C# tool)
1818
uses: actions/setup-dotnet@v3
1919
with:
2020
dotnet-version: '6.0.x'
2121

22+
- name: Setup Python (In case the tool relies on Python scripts)
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.10'
26+
2227
- name: Create Directory Structure
2328
run: |
2429
New-Item -ItemType Directory -Force -Path "Build\Admin\Mods"
25-
# Pre-create the Documents path so the bat file has a valid target if it uses absolute paths
2630
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\Documents\Battlefield 3\Server\Admin\Mods"
2731
2832
# --- 1. CLONE REALITYMOD & MODS ---
@@ -69,7 +73,7 @@ jobs:
6973
exit 1
7074
}
7175
72-
# --- 5. RM LEVEL LOADER GEN (Build -> Patch Bat -> Run Bat) ---
76+
# --- 5. RM LEVEL LOADER GEN ---
7377
- name: Run RMLevelLoaderGen
7478
working-directory: ${{ github.workspace }}
7579
env:
@@ -79,31 +83,30 @@ jobs:
7983
git clone --recurse-submodules https://oauth2:$env:GH_TOKEN@github.com/BF3RM/RMLevelLoaderGen.git temp_loader
8084
cd temp_loader
8185
82-
# 2. BUILD THE TOOL (Essential step if exe is missing)
86+
# 2. BUILD THE TOOL (C#)
87+
# Even if Python is needed later, the entry point seems to be a C# binary in /bin
8388
Write-Host "--- Building LevelLoaderGen ---"
8489
dotnet build .\LevelLoaderGen\LevelLoaderGen.csproj -c Release -o .\LevelLoaderGen\bin
8590
8691
# 3. PATCH generate.bat
87-
# Remove 'pause' (so it doesn't hang) and fix slashes just in case
92+
# Remove 'pause', fix slashes
8893
$content = Get-Content generate.bat -Raw
8994
$content = $content -replace 'pause', 'REM pause'
9095
$content = $content -replace '/', '\'
9196
Set-Content -Path generate.bat -Value $content
9297
9398
# 4. EXECUTE generate.bat
99+
# We run this in a cmd shell to ensure standard Windows behavior
94100
Write-Host "--- Executing generate.bat ---"
95101
cmd /c generate.bat
96102
97103
# 5. FIND AND MOVE OUTPUT
98104
$Dest = "..\Build\Admin\Mods\rm-levelloader"
99105
100-
# Check Local Folder (Most likely target based on bat file)
101106
if (Test-Path "mods\rm-levelloader") {
102107
Write-Host "Found output in local mods folder."
103108
Move-Item -Path "mods\rm-levelloader" -Destination $Dest -Force
104-
}
105-
# Check Documents Folder (Fallback)
106-
elseif (Test-Path "$env:USERPROFILE\Documents\Battlefield 3\Server\Admin\Mods\RMLevelLoaderGen\mods\rm-levelloader") {
109+
} elseif (Test-Path "$env:USERPROFILE\Documents\Battlefield 3\Server\Admin\Mods\RMLevelLoaderGen\mods\rm-levelloader") {
107110
Write-Host "Found output in Documents folder."
108111
Move-Item -Path "$env:USERPROFILE\Documents\Battlefield 3\Server\Admin\Mods\RMLevelLoaderGen\mods\rm-levelloader" -Destination $Dest -Force
109112
} else {

0 commit comments

Comments
 (0)