mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-21 00:03:47 +00:00
Build script
This commit is contained in:
parent
1ed08d6a58
commit
101fa7d182
6 changed files with 83 additions and 5 deletions
43
Export.ps1
43
Export.ps1
|
|
@ -1 +1,42 @@
|
|||
F:\Apps\Godot_v4.4\Godot_v4.4-rc1_mono_win64.exe --headless --export-release "Windows Desktop" .\build\Cirno_No_Reason.exe
|
||||
# Define paths
|
||||
$gitVersionPath = "dotnet-gitversion.exe"
|
||||
$godotPath = "F:\Apps\Godot_v4.4\Godot_v4.4-rc1_mono_win64.exe"
|
||||
$buildDir = ".\build"
|
||||
$configFile = "export_presets.cfg"
|
||||
$zipOutputDir = ".\release"
|
||||
$fileName = "Cirno_No_Reason"
|
||||
|
||||
# Step 1: Clear the build directory
|
||||
if (Test-Path $buildDir) {
|
||||
Remove-Item "$buildDir\*" -Recurse -Force
|
||||
} else {
|
||||
New-Item -ItemType Directory -Path $buildDir | Out-Null
|
||||
}
|
||||
|
||||
# Step 2: Get version data from GitVersion
|
||||
$gitVersionOutput = & $gitVersionPath | ConvertFrom-Json
|
||||
$assemblySemFileVer = $gitVersionOutput.AssemblySemFileVer
|
||||
$assemblySemVer = $gitVersionOutput.AssemblySemVer
|
||||
$fullSemVer = $gitVersionOutput.FullSemVer
|
||||
|
||||
# Step 3: Set environment variables for use in the build process
|
||||
[System.Environment]::SetEnvironmentVariable("GIT_ASSEMBLY_SEM_FILE_VER", $assemblySemFileVer, [System.EnvironmentVariableTarget]::Process)
|
||||
[System.Environment]::SetEnvironmentVariable("GIT_ASSEMBLY_SEM_VER", $assemblySemVer, [System.EnvironmentVariableTarget]::Process)
|
||||
|
||||
Write-Host "Set environment variables:"
|
||||
Write-Host " GIT_ASSEMBLY_SEM_FILE_VER = $assemblySemFileVer"
|
||||
Write-Host " GIT_ASSEMBLY_SEM_VER = $assemblySemVer"
|
||||
|
||||
# Step 3: Update export_presets.cfg
|
||||
if (Test-Path $configFile) {
|
||||
(Get-Content $configFile) `
|
||||
-replace 'application/file_version="[^"]*"', "application/file_version=`"$assemblySemFileVer`"" `
|
||||
-replace 'application/product_version="[^"]*"', "application/product_version=`"$assemblySemVer`"" `
|
||||
| Set-Content $configFile
|
||||
} else {
|
||||
Write-Host "Warning: $configFile not found!"
|
||||
}
|
||||
|
||||
# Step 4: Export the build
|
||||
& $godotPath --headless --export-release "Windows Desktop" "$buildDir\$fileName.exe"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue