mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-07-02 23:11:17 +00:00
New Build scripts
This commit is contained in:
parent
e969e79591
commit
c9a7eee188
8 changed files with 964 additions and 86 deletions
86
Publish.ps1
86
Publish.ps1
|
|
@ -1,45 +1,57 @@
|
|||
$butlerPath = "F:\Apps\butler\butler.exe"
|
||||
$zipOutputDir = ".\release"
|
||||
$fileName = "Cirno_No_Reason"
|
||||
$gitVersionPath = "dotnet-gitversion.exe"
|
||||
# Publish Script for Cirno No Reason
|
||||
# Publishes builds to itch.io using Butler
|
||||
|
||||
# Import the module
|
||||
$modulePath = Join-Path $PSScriptRoot "CirnoBuild.psm1"
|
||||
Import-Module $modulePath -Force
|
||||
|
||||
# Configuration
|
||||
$butlerPath = "F:\Apps\butler\butler.exe"
|
||||
$releaseDir = ".\release"
|
||||
$buildDir = ".\build"
|
||||
$godotPath = $env:GODOT
|
||||
$platforms = Get-PlatformConfigurations
|
||||
|
||||
$gitVersionOutput = & $gitVersionPath | ConvertFrom-Json
|
||||
$assemblySemFileVer = $gitVersionOutput.AssemblySemFileVer
|
||||
$assemblySemVer = $gitVersionOutput.AssemblySemVer
|
||||
$fullSemVer = $gitVersionOutput.FullSemVer
|
||||
$PreReleaseLabel = $gitVersionOutput.PreReleaseLabelWithDash
|
||||
# Validate prerequisites
|
||||
$prereqResult = Test-Prerequisites -GodotPath $godotPath -ButlerPath $butlerPath
|
||||
if (-not $prereqResult.Valid) {
|
||||
exit 1
|
||||
}
|
||||
|
||||
#$zipFileName = "$fileName.$fullSemVer.win.zip"
|
||||
#$zipFileNameLinux = "$fileName.$fullSemVer.linux.zip"
|
||||
#$zipFilePath = "$zipOutputDir\$zipFileName"
|
||||
#$zipFilePathLinux = "$zipOutputDir\$zipFileNameLinux"
|
||||
# Use resolved path if available
|
||||
if ($prereqResult.ResolvedGodotPath) {
|
||||
$godotPath = $prereqResult.ResolvedGodotPath
|
||||
}
|
||||
|
||||
Write-Host "Getting version information..."
|
||||
$versionInfo = Get-VersionInfo
|
||||
|
||||
Write-Host ""
|
||||
|
||||
# Ensure output directory exists
|
||||
if (!(Test-Path $zipOutputDir)) {
|
||||
New-Item -ItemType Directory -Path $zipOutputDir | Out-Null
|
||||
if (!(Test-Path $releaseDir)) {
|
||||
New-Item -ItemType Directory -Path $releaseDir | Out-Null
|
||||
}
|
||||
|
||||
function Handle-BuildArtifact {
|
||||
param (
|
||||
[string]$platform,
|
||||
[string]$label
|
||||
)
|
||||
|
||||
$sourcePath = Join-Path $buildDir $platform
|
||||
$zipFileName = "$fileName.$fullSemVer.$platform.zip"
|
||||
$zipFilePath = Join-Path $zipOutputDir $zipFileName
|
||||
$butlerTarget = "maddoscientisto/cirno-no-reason:$platform$label"
|
||||
|
||||
$files = Get-ChildItem -Path $sourcePath -Recurse -File -ErrorAction SilentlyContinue
|
||||
if ($files) {
|
||||
Compress-Archive -Path "$sourcePath\*" -DestinationPath $zipFilePath -Force
|
||||
Write-Host "$platform build completed and packaged as $zipFilePath"
|
||||
& $butlerPath push $zipFilePath $butlerTarget --userversion $fullSemVer
|
||||
} else {
|
||||
Write-Warning "$platform build folder is empty or missing: $sourcePath"
|
||||
}
|
||||
# Publish all platforms
|
||||
$results = @{}
|
||||
foreach ($platformKey in $platforms.Keys) {
|
||||
$results[$platformKey] = Publish-PlatformBuild `
|
||||
-Platform $platformKey `
|
||||
-VersionInfo $versionInfo `
|
||||
-BuildDir $buildDir `
|
||||
-ReleaseDir $releaseDir `
|
||||
-ButlerPath $butlerPath
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
Handle-BuildArtifact -platform "win" -label $PreReleaseLabel
|
||||
Handle-BuildArtifact -platform "linux" -label $PreReleaseLabel
|
||||
# Summary
|
||||
Write-Host "=====================================" -ForegroundColor Cyan
|
||||
Write-Host " Publish Summary" -ForegroundColor Cyan
|
||||
Write-Host "=====================================" -ForegroundColor Cyan
|
||||
foreach ($platformKey in $results.Keys) {
|
||||
$status = if ($results[$platformKey]) { "SUCCESS" } else { "FAILED" }
|
||||
$color = if ($results[$platformKey]) { "Green" } else { "Red" }
|
||||
$platformName = $platforms[$platformKey].ExportName
|
||||
Write-Host " $platformName : $status" -ForegroundColor $color
|
||||
}
|
||||
Write-Host ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue