diff --git a/PostPublish.ps1 b/PostPublish.ps1 index d1087e02f..d7a64f452 100644 --- a/PostPublish.ps1 +++ b/PostPublish.ps1 @@ -9,4 +9,13 @@ foreach($localization in $localizations) $filePath = "{0}\Localization\IW4MAdmin.{1}.json" -f $PublishDir, $localization $response = Invoke-WebRequest $url Out-File -FilePath $filePath -InputObject $response.Content -Encoding utf8 -} \ No newline at end of file +} + +$versionInfo = (Get-Command ("{0}\IW4MAdmin.exe" -f $PublishDir)).FileVersionInfo +$json = @{ +Major = $versionInfo.ProductMajorPart +Minor = $versionInfo.ProductMinorPart +Build = $versionInfo.ProductBuildPart +Revision = $versionInfo.ProductPrivatePart +} +$json | ConvertTo-Json > VersionInformation.json \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 87cd81f51..cd98c510f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -39,6 +39,12 @@ steps: platform: '$(buildPlatform)' configuration: '$(buildConfiguration)' +- task: oneLuckiDevJson2Variable@1 + inputs: + jsonFile: '$(build.artifactStagingDirectory)\Application\VersionInformation.json' + shouldPrefixVariables: true + variablePrefix: 'VersionInformation' + - task: DotNetCoreCLI@2 inputs: command: 'publish' @@ -101,7 +107,7 @@ steps: rootFolderOrFile: '$(outputFolder)' includeRootFolder: false archiveType: 'zip' - archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' + archiveFile: '$(Build.ArtifactStagingDirectory)/IW4MAdmin-v$(VersionInformation.Major).$(VersionInformation.Minor)-$(configuration)$(VersionInformation.Build)r$(VersionInformation.Revision)-$(Build.BuildId).zip' replaceExistingArchive: true - task: FtpUpload@2