grab version information from file to setup output zip name

This commit is contained in:
RaidMax 2019-12-07 19:52:03 -06:00
parent 890c419133
commit 3b4af20810
2 changed files with 17 additions and 2 deletions

View File

@ -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
}
}
$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

View File

@ -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