From 1dd0fbee84086d0ab4f7011c46cf48fad1cddac4 Mon Sep 17 00:00:00 2001 From: Brett Hewitson Date: Thu, 22 Dec 2022 02:15:12 +1000 Subject: [PATCH] Update azure-pipelines.yml for Azure Pipelines --- .azure/pipelines/azure-pipelines.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.azure/pipelines/azure-pipelines.yml b/.azure/pipelines/azure-pipelines.yml index d913df79..a3e9ea67 100644 --- a/.azure/pipelines/azure-pipelines.yml +++ b/.azure/pipelines/azure-pipelines.yml @@ -164,14 +164,24 @@ stages: configuration: '$(BuildConfiguration)' clean: true - - task: ArchiveFiles@2 + - task: PowerShell@2 displayName: Archive Binaries + env: + BUILD_BUILDNUMBER: $(Build.BuildNumber) + BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory) inputs: - rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/Application Files/$(ApplicationName)_*" - includeRootFolder: false - archiveType: 'zip' - archiveFile: '$(Build.ArtifactStagingDirectory)/latest.zip' - replaceExistingArchive: true + targetType: 'inline' + script: | + $appVersion = $env:BUILD_BUILDNUMBER + $appVersionShort = $appVersion.Substring(0, $appVersion.LastIndexOf('.')) + $appVersionWithUnderscores = $appVersion.Replace('.', '_') + $sourcePath = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/Application Files/ARK Server Manager_$appVersionWithUnderscores" + $zipFile = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/latest.zip" + + Add-Type -Assembly System.IO.Compression.FileSystem + $compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal + [System.IO.Compression.ZipFile]::CreateFromDirectory($sourcePath, $zipFile, $compressionLevel, $false) + pwsh: true - task: CopyFiles@2 displayName: 'Copy Artifact Files' @@ -211,7 +221,6 @@ stages: "@ $installTextFileContent | Out-File -LiteralPath:$installTextFile -Force -Encoding ascii - #& "$env:AGENTCAPABILITIES_USER_INNOSETUP" /J"$installTextFile" "$installScriptFile" & "$env:AGENTCAPABILITIES_USER_INNOSETUP" "$installScriptFile" pwsh: true