diff --git a/.azure/pipelines/azure-pipelines.yml b/.azure/pipelines/azure-pipelines.yml index c5552d73..a59ebb7e 100644 --- a/.azure/pipelines/azure-pipelines.yml +++ b/.azure/pipelines/azure-pipelines.yml @@ -172,8 +172,18 @@ stages: inputs: targetType: 'inline' script: | + $fileExtension = '.application' + + $applicationFiles = Get-ChildItem -Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY -Filter "*$fileExtension" -File -Name + $applicationFile = $applicationFiles.Where({$_.Replace(' ', '') -eq "$(ApplicationName)$($fileExtension)"}) + if ($applicationFile.Count -ne 1) { + throw 'Could not find the application file (*.application)' + } + $applicationFileName = [System.IO.Path]::GetFileNameWithoutExtension($applicationFile[0]) + $applicationFolder = "$($applicationFileName)_$($appVersionWithUnderscores)" + $appVersionWithUnderscores = $env:BUILD_BUILDNUMBER.Replace('.', '_') - $sourcePath = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/Application Files/ARK Server Manager_$appVersionWithUnderscores" + $sourcePath = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/Application Files/$applicationFolder" $zipFile = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/latest.zip" Add-Type -Assembly System.IO.Compression.FileSystem