mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-15 05:43:47 +00:00
Build tweaks
This commit is contained in:
parent
68daf9c372
commit
40179c193d
5 changed files with 93 additions and 10 deletions
47
Export-linux.ps1
Normal file
47
Export-linux.ps1
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# Define paths
|
||||
$gitVersionPath = "dotnet-gitversion.exe"
|
||||
$godotPath = $env:GODOT
|
||||
$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
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Path $buildDir\win | Out-Null
|
||||
New-Item -ItemType Directory -Path $buildDir\linux | 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"
|
||||
#& $godotPath --headless --export-release "Windows Desktop" "$buildDir\win\$fileName.exe"
|
||||
|
||||
& $godotPath --headless --export-release "Linux" "$buildDir\linux\$fileName.x86_64"
|
||||
Loading…
Add table
Add a link
Reference in a new issue