mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
parameter updates
This commit is contained in:
parent
6644f37d64
commit
efb8585f8d
1 changed files with 21 additions and 21 deletions
|
|
@ -7,7 +7,7 @@ parameters:
|
|||
default: 'src/Server-Managers.sln'
|
||||
- name: ProjectFile
|
||||
type: string
|
||||
default: 'src/$(ApplicationName)/$(ApplicationName).csproj'
|
||||
default: 'src/${{parameters.ApplicationName}}/${{parameters.ApplicationName}}.csproj'
|
||||
- name: BuildPlatform
|
||||
type: string
|
||||
default: AnyCPU
|
||||
|
|
@ -54,37 +54,37 @@ stages:
|
|||
- task: NuGetCommand@2
|
||||
displayName: NuGet Restore
|
||||
inputs:
|
||||
restoreSolution: '$(SolutionFile)'
|
||||
restoreSolution: '${{parameters.SolutionFile}}'
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Apply Semantic Versioning to AssemblyInfo Files
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: './.azure/scripts/ApplySemanticVersioningToAssemblies.ps1'
|
||||
arguments: "-applicationName $(ApplicationName) -pathToSearch '$(Build.SourcesDirectory)/src' -buildNumber $(Build.BuildNumber) -searchFilter 'AssemblyInfo.*'"
|
||||
arguments: "-applicationName ${{parameters.ApplicationName}} -pathToSearch '$(Build.SourcesDirectory)/src' -buildNumber $(Build.BuildNumber) -searchFilter 'AssemblyInfo.*'"
|
||||
pwsh: true
|
||||
|
||||
- task: projectfileprops@1
|
||||
displayName: Modify ApplicationVersion in Project File
|
||||
inputs:
|
||||
path: '$(ProjectFile)'
|
||||
path: '${{parameters.ProjectFile}}'
|
||||
fieldOptions: ApplicationVersion
|
||||
value: '$(VersionMajor).$(VersionMinor).$(VersionBuild).%2a'
|
||||
|
||||
- task: projectfileprops@1
|
||||
displayName: Modify ApplicationRevision in Project File
|
||||
inputs:
|
||||
path: '$(ProjectFile)'
|
||||
path: '${{parameters.ProjectFile}}'
|
||||
fieldOptions: ApplicationRevision
|
||||
value: '$(VersionRevision)'
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: Build $(ApplicationName) Project
|
||||
displayName: Build ${{parameters.ApplicationName}} Project
|
||||
inputs:
|
||||
solution: '$(ProjectFile)'
|
||||
solution: '${{parameters.ProjectFile}}'
|
||||
msbuildArgs: '/t:publish /p:PublishDir="$(Build.BinariesDirectory)"'
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
platform: '${{parameters.BuildPlatform}}'
|
||||
configuration: '${{parameters.BuildConfiguration}}'
|
||||
clean: true
|
||||
|
||||
- task: PowerShell@2
|
||||
|
|
@ -105,13 +105,13 @@ stages:
|
|||
|
||||
# Rename application files folder
|
||||
$applicationFolders = Get-ChildItem -Path "$env:BUILD_BINARIESDIRECTORY\Application Files" -Filter "*_$appVersionWithUnderscores" -Directory -Name
|
||||
$applicationFolder = $applicationFolders.Where({$_.Replace(' ', '') -eq "$(ApplicationName)_$appVersionWithUnderscores"})
|
||||
$applicationFolder = $applicationFolders.Where({$_.Replace(' ', '') -eq "${{parameters.ApplicationName}}_$appVersionWithUnderscores"})
|
||||
if ($applicationFolder.Count -ne 1) {
|
||||
throw "Could not find the application folder ($(ApplicationName)_$appVersionWithUnderscores)"
|
||||
throw "Could not find the application folder (${{parameters.ApplicationName}}_$appVersionWithUnderscores)"
|
||||
}
|
||||
$applicationFolderName = $applicationFolder[0]
|
||||
|
||||
Rename-Item -Path "$env:BUILD_BINARIESDIRECTORY\Application Files\$applicationFolderName" -NewName "$env:BUILD_BINARIESDIRECTORY\Application Files\$(ApplicationName)_$appVersionWithUnderscores" -Force
|
||||
Rename-Item -Path "$env:BUILD_BINARIESDIRECTORY\Application Files\$applicationFolderName" -NewName "$env:BUILD_BINARIESDIRECTORY\Application Files\${{parameters.ApplicationName}}_$appVersionWithUnderscores" -Force
|
||||
pwsh: true
|
||||
|
||||
- task: CopyFiles@2
|
||||
|
|
@ -119,9 +119,9 @@ stages:
|
|||
inputs:
|
||||
SourceFolder: '$(Build.SourcesDirectory)'
|
||||
Contents: |
|
||||
src/$(ApplicationName)/VersionFeed.xml
|
||||
src/$(ApplicationName)/VersionFeedBeta.xml
|
||||
src/$(ApplicationName)/Globalization/en-US/en-US.xaml
|
||||
src/${{parameters.ApplicationName}}/VersionFeed.xml
|
||||
src/${{parameters.ApplicationName}}/VersionFeedBeta.xml
|
||||
src/${{parameters.ApplicationName}}/Globalization/en-US/en-US.xaml
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
|
|
@ -161,10 +161,10 @@ stages:
|
|||
$appVersionShort = $appVersion.Substring(0, $appVersion.LastIndexOf('.'))
|
||||
$appVersionWithUnderscores = $appVersion.Replace('.', '_')
|
||||
|
||||
$installScriptFile = ".azure/scripts/$(ApplicationName).iss"
|
||||
$installScriptFile = ".azure/scripts/${{parameters.ApplicationName}}.iss"
|
||||
$installTextFile = '.azure/scripts/Installer.txt'
|
||||
|
||||
$sourceIconFile = "$env:BUILD_SOURCESDIRECTORY/src/$(ApplicationName)/Art/favicon.ico"
|
||||
$sourceIconFile = "$env:BUILD_SOURCESDIRECTORY/src/${{parameters.ApplicationName}}/Art/favicon.ico"
|
||||
$destIconFile = "$env:BUILD_BINARIESDIRECTORY/favicon.ico"
|
||||
Copy-Item -Path "$sourceIconFile" -Destination "$destIconFile" -Force
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ stages:
|
|||
script: |
|
||||
$appVersion = $env:BUILD_BUILDNUMBER
|
||||
$appVersionWithUnderscores = $appVersion.Replace('.', '_')
|
||||
$applicationFolderName = "$(ApplicationName)_$($appVersionWithUnderscores)"
|
||||
$applicationFolderName = "${{parameters.ApplicationName}}_$($appVersionWithUnderscores)"
|
||||
|
||||
$sourcePath = "$env:BUILD_BINARIESDIRECTORY/Application Files/$applicationFolderName"
|
||||
Copy-Item -Path "$sourcePath\ServerManagerUpdater.exe" -Destination "$sourcePath\NewServerManagerUpdater.exe" -Force
|
||||
|
|
@ -208,11 +208,11 @@ stages:
|
|||
$appVersion = $env:BUILD_BUILDNUMBER
|
||||
$appVersionShort = $appVersion.Substring(0, $appVersion.LastIndexOf('.'))
|
||||
$appVersionWithUnderscores = $appVersion.Replace('.', '_')
|
||||
$applicationFolderName = "$(ApplicationName)_$($appVersionWithUnderscores)"
|
||||
$applicationFolderName = "${{parameters.ApplicationName}}_$($appVersionWithUnderscores)"
|
||||
|
||||
$sourcePath = "$env:BUILD_BINARIESDIRECTORY/Application Files/$applicationFolderName"
|
||||
$zipFile1 = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/latest.zip"
|
||||
$zipFile2 = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/$(ApplicationName)_$($appVersionShort).zip"
|
||||
$zipFile2 = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/${{parameters.ApplicationName}}_$($appVersionShort).zip"
|
||||
|
||||
Add-Type -Assembly System.IO.Compression.FileSystem
|
||||
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
|
||||
|
|
@ -226,4 +226,4 @@ stages:
|
|||
enabled: true
|
||||
inputs:
|
||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
||||
ArtifactName: '$(PublishFolder)'
|
||||
ArtifactName: '${{parameters.PublishFolder}}'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue