mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-07-03 21:51:16 +00:00
New export and publish scripts
This commit is contained in:
parent
01e61cb685
commit
881a4897da
4 changed files with 37 additions and 100 deletions
39
Publish.ps1
39
Publish.ps1
|
|
@ -10,25 +10,36 @@ $assemblySemVer = $gitVersionOutput.AssemblySemVer
|
|||
$fullSemVer = $gitVersionOutput.FullSemVer
|
||||
$PreReleaseLabel = $gitVersionOutput.PreReleaseLabelWithDash
|
||||
|
||||
$zipFileName = "$fileName.$fullSemVer.win.zip"
|
||||
$zipFileNameLinux = "$fileName.$fullSemVer.linux.zip"
|
||||
$zipFilePath = "$zipOutputDir\$zipFileName"
|
||||
$zipFilePathLinux = "$zipOutputDir\$zipFileNameLinux"
|
||||
#$zipFileName = "$fileName.$fullSemVer.win.zip"
|
||||
#$zipFileNameLinux = "$fileName.$fullSemVer.linux.zip"
|
||||
#$zipFilePath = "$zipOutputDir\$zipFileName"
|
||||
#$zipFilePathLinux = "$zipOutputDir\$zipFileNameLinux"
|
||||
|
||||
# Zip the build folder
|
||||
# Ensure output directory exists
|
||||
if (!(Test-Path $zipOutputDir)) {
|
||||
New-Item -ItemType Directory -Path $zipOutputDir | Out-Null
|
||||
}
|
||||
|
||||
Compress-Archive -Path "$buildDir\win\*" -DestinationPath $zipFilePath -Force
|
||||
#Compress-Archive -Path "$buildDir\*" -DestinationPath $zipFilePath -Force
|
||||
function Handle-BuildArtifact {
|
||||
param (
|
||||
[string]$platform,
|
||||
[string]$label
|
||||
)
|
||||
|
||||
Write-Host "Windows Build completed and packaged as $zipFilePath"
|
||||
$sourcePath = Join-Path $buildDir $platform
|
||||
$zipFileName = "$fileName.$fullSemVer.$platform.zip"
|
||||
$zipFilePath = Join-Path $zipOutputDir $zipFileName
|
||||
$butlerTarget = "maddoscientisto/cirno-no-reason:$platform$label"
|
||||
|
||||
#Compress-Archive -Path "$buildDir\linux\*" -DestinationPath $zipFilePathLinux -Force
|
||||
$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"
|
||||
}
|
||||
}
|
||||
|
||||
#Write-Host "Linux Build completed and packaged as $zipFilePathLinux"
|
||||
|
||||
& $butlerPath push $zipFilePath maddoscientisto/cirno-no-reason:windows$PreReleaseLabel --userversion $fullSemVer
|
||||
|
||||
#& $butlerPath push $zipFilePathLinux maddoscientisto/cirno-no-reason:linux$PreReleaseLabel --userversion $fullSemVer
|
||||
Handle-BuildArtifact -platform "win" -label $PreReleaseLabel
|
||||
Handle-BuildArtifact -platform "linux" -label $PreReleaseLabel
|
||||
Loading…
Add table
Add a link
Reference in a new issue