mirror of
https://github.com/tribufu/ServerManagers
synced 2026-06-01 09:42:39 +00:00
Update azure-pipelines.yml for Azure Pipelines
This commit is contained in:
parent
74ac3d3e0c
commit
6116dbb452
1 changed files with 99 additions and 54 deletions
|
|
@ -124,17 +124,17 @@ stages:
|
||||||
pwsh: true
|
pwsh: true
|
||||||
|
|
||||||
- task: NuGetToolInstaller@1
|
- task: NuGetToolInstaller@1
|
||||||
displayName: 'Install NuGet 4.4.1'
|
displayName: Install NuGet 4.4.1
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: '4.4.1'
|
versionSpec: '4.4.1'
|
||||||
|
|
||||||
- task: NuGetCommand@2
|
- task: NuGetCommand@2
|
||||||
displayName: 'NuGet restore'
|
displayName: NuGet Restore
|
||||||
inputs:
|
inputs:
|
||||||
restoreSolution: '$(SolutionFile)'
|
restoreSolution: '$(SolutionFile)'
|
||||||
|
|
||||||
- task: PowerShell@2
|
- task: PowerShell@2
|
||||||
displayName: 'Apply Semantic Versioning to Assemblies'
|
displayName: Apply Semantic Versioning to AssemblyInfo Files
|
||||||
inputs:
|
inputs:
|
||||||
targetType: filePath
|
targetType: filePath
|
||||||
filePath: './.azure/scripts/ApplySemanticVersioningToAssemblies.ps1'
|
filePath: './.azure/scripts/ApplySemanticVersioningToAssemblies.ps1'
|
||||||
|
|
@ -142,21 +142,21 @@ stages:
|
||||||
pwsh: true
|
pwsh: true
|
||||||
|
|
||||||
- task: projectfileprops@1
|
- task: projectfileprops@1
|
||||||
displayName: 'Modify ApplicationVersion In Project File'
|
displayName: Modify ApplicationVersion in Project File
|
||||||
inputs:
|
inputs:
|
||||||
path: '$(ProjectFile)'
|
path: '$(ProjectFile)'
|
||||||
fieldOptions: ApplicationVersion
|
fieldOptions: ApplicationVersion
|
||||||
value: '$(VersionMajor).$(VersionMinor).$(VersionBuild).%2a'
|
value: '$(VersionMajor).$(VersionMinor).$(VersionBuild).%2a'
|
||||||
|
|
||||||
- task: projectfileprops@1
|
- task: projectfileprops@1
|
||||||
displayName: 'Modify ApplicationRevision In Project File'
|
displayName: Modify ApplicationRevision in Project File
|
||||||
inputs:
|
inputs:
|
||||||
path: '$(ProjectFile)'
|
path: '$(ProjectFile)'
|
||||||
fieldOptions: ApplicationRevision
|
fieldOptions: ApplicationRevision
|
||||||
value: '$(VersionRevision)'
|
value: '$(VersionRevision)'
|
||||||
|
|
||||||
- task: VSBuild@1
|
- task: VSBuild@1
|
||||||
displayName: 'Build $(ApplicationName) Project'
|
displayName: Build $(ApplicationName) Project
|
||||||
inputs:
|
inputs:
|
||||||
solution: '$(ProjectFile)'
|
solution: '$(ProjectFile)'
|
||||||
msbuildArgs: '/t:publish /p:PublishDir="$(Build.ArtifactStagingDirectory)"'
|
msbuildArgs: '/t:publish /p:PublishDir="$(Build.ArtifactStagingDirectory)"'
|
||||||
|
|
@ -164,51 +164,6 @@ stages:
|
||||||
configuration: '$(BuildConfiguration)'
|
configuration: '$(BuildConfiguration)'
|
||||||
clean: true
|
clean: true
|
||||||
|
|
||||||
- task: PowerShell@2
|
|
||||||
displayName: Archive Binaries
|
|
||||||
env:
|
|
||||||
BUILD_BUILDNUMBER: $(Build.BuildNumber)
|
|
||||||
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
|
||||||
inputs:
|
|
||||||
targetType: 'inline'
|
|
||||||
script: |
|
|
||||||
$appVersion = $env:BUILD_BUILDNUMBER
|
|
||||||
$appVersionWithUnderscores = $appVersion.Replace('.', '_')
|
|
||||||
$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 ($(ApplicationName)$fileExtension)"
|
|
||||||
}
|
|
||||||
$applicationFileName = [System.IO.Path]::GetFileNameWithoutExtension($applicationFile[0])
|
|
||||||
$applicationFolder = "$($applicationFileName)_$($appVersionWithUnderscores)"
|
|
||||||
|
|
||||||
$sourcePath = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/Application Files/$applicationFolder"
|
|
||||||
$zipFile1 = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/latest.zip"
|
|
||||||
$zipFile2 = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/$($applicationFileName.Replace(' ', ''))_$($appVersion).zip"
|
|
||||||
|
|
||||||
Add-Type -Assembly System.IO.Compression.FileSystem
|
|
||||||
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
|
|
||||||
[System.IO.Compression.ZipFile]::CreateFromDirectory($sourcePath, $zipFile1, $compressionLevel, $false)
|
|
||||||
|
|
||||||
Copy-Item -Path "$zipFile1" -Destination "$zipFile2" -Verbose
|
|
||||||
pwsh: true
|
|
||||||
|
|
||||||
- task: CopyFiles@2
|
|
||||||
displayName: 'Copy Artifact Files'
|
|
||||||
inputs:
|
|
||||||
SourceFolder: '$(Build.SourcesDirectory)'
|
|
||||||
Contents: |
|
|
||||||
src/$(ApplicationName)/VersionFeed.xml
|
|
||||||
src/$(ApplicationName)/VersionFeedBeta.xml
|
|
||||||
src/$(ApplicationName)/Art/favicon.ico
|
|
||||||
src/$(ApplicationName)/Globalization/en-US/en-US.xaml
|
|
||||||
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
||||||
OverWrite: true
|
|
||||||
flattenFolders: true
|
|
||||||
preserveTimestamp: true
|
|
||||||
|
|
||||||
- task: PowerShell@2
|
- task: PowerShell@2
|
||||||
displayName: Create Installer File
|
displayName: Create Installer File
|
||||||
env:
|
env:
|
||||||
|
|
@ -221,7 +176,7 @@ stages:
|
||||||
$appVersion = $env:BUILD_BUILDNUMBER
|
$appVersion = $env:BUILD_BUILDNUMBER
|
||||||
$appVersionShort = $appVersion.Substring(0, $appVersion.LastIndexOf('.'))
|
$appVersionShort = $appVersion.Substring(0, $appVersion.LastIndexOf('.'))
|
||||||
$appVersionWithUnderscores = $appVersion.Replace('.', '_')
|
$appVersionWithUnderscores = $appVersion.Replace('.', '_')
|
||||||
$publishPath = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY"
|
|
||||||
$installScriptFile = ".azure/scripts/$(ApplicationName).iss"
|
$installScriptFile = ".azure/scripts/$(ApplicationName).iss"
|
||||||
$installTextFile = '.azure/scripts/Installer.txt'
|
$installTextFile = '.azure/scripts/Installer.txt'
|
||||||
|
|
||||||
|
|
@ -229,15 +184,105 @@ stages:
|
||||||
#define AppVer "$appVersionShort"
|
#define AppVer "$appVersionShort"
|
||||||
#define AppVerFull "$appVersion"
|
#define AppVerFull "$appVersion"
|
||||||
#define AppVerPath "$appVersionWithUnderscores"
|
#define AppVerPath "$appVersionWithUnderscores"
|
||||||
#define RootPath "$publishPath"
|
#define RootPath "$env:BUILD_ARTIFACTSTAGINGDIRECTORY"
|
||||||
"@
|
"@
|
||||||
$installTextFileContent | Out-File -LiteralPath:$installTextFile -Force -Encoding ascii
|
$installTextFileContent | Out-File -LiteralPath:$installTextFile -Force -Encoding ascii
|
||||||
|
|
||||||
& "$env:AGENTCAPABILITIES_USER_INNOSETUP" "$installScriptFile"
|
& "$env:AGENTCAPABILITIES_USER_INNOSETUP" "$installScriptFile"
|
||||||
pwsh: true
|
pwsh: true
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: Create Duplicate Updater File
|
||||||
|
env:
|
||||||
|
BUILD_BUILDNUMBER: $(Build.BuildNumber)
|
||||||
|
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
||||||
|
inputs:
|
||||||
|
targetType: 'inline'
|
||||||
|
script: |
|
||||||
|
$appVersion = $env:BUILD_BUILDNUMBER
|
||||||
|
$appVersionShort = $appVersion.Substring(0, $appVersion.LastIndexOf('.'))
|
||||||
|
$appVersionWithUnderscores = $appVersion.Replace('.', '_')
|
||||||
|
|
||||||
|
$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 ($(ApplicationName)$fileExtension)"
|
||||||
|
}
|
||||||
|
$applicationFileName = [System.IO.Path]::GetFileNameWithoutExtension($applicationFile[0])
|
||||||
|
$applicationFolder = "$($applicationFileName)_$($appVersionWithUnderscores)"
|
||||||
|
|
||||||
|
$sourcePath = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/Application Files/$applicationFolder"
|
||||||
|
Copy-Item -Path "$sourcePath\ServerManagerUpdater.exe" -Destination "$sourcePath\NewServerManagerUpdater.exe" -Force
|
||||||
|
pwsh: true
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: Archive Binary Files
|
||||||
|
env:
|
||||||
|
BUILD_BUILDNUMBER: $(Build.BuildNumber)
|
||||||
|
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
||||||
|
inputs:
|
||||||
|
targetType: 'inline'
|
||||||
|
script: |
|
||||||
|
$appVersion = $env:BUILD_BUILDNUMBER
|
||||||
|
$appVersionShort = $appVersion.Substring(0, $appVersion.LastIndexOf('.'))
|
||||||
|
$appVersionWithUnderscores = $appVersion.Replace('.', '_')
|
||||||
|
|
||||||
|
$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 ($(ApplicationName)$fileExtension)"
|
||||||
|
}
|
||||||
|
$applicationFileName = [System.IO.Path]::GetFileNameWithoutExtension($applicationFile[0])
|
||||||
|
$applicationFolder = "$($applicationFileName)_$($appVersionWithUnderscores)"
|
||||||
|
|
||||||
|
$sourcePath = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/Application Files/$applicationFolder"
|
||||||
|
$zipFile1 = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/latest.zip"
|
||||||
|
$zipFile2 = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/$($applicationFileName.Replace(' ', ''))_$($appVersionShort).zip"
|
||||||
|
|
||||||
|
Add-Type -Assembly System.IO.Compression.FileSystem
|
||||||
|
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
|
||||||
|
[System.IO.Compression.ZipFile]::CreateFromDirectory($sourcePath, $zipFile1, $compressionLevel, $false)
|
||||||
|
|
||||||
|
Copy-Item -Path "$zipFile1" -Destination "$zipFile2" -Force
|
||||||
|
pwsh: true
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: Create Latest Version Files
|
||||||
|
env:
|
||||||
|
BUILD_BUILDNUMBER: $(Build.BuildNumber)
|
||||||
|
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
||||||
|
inputs:
|
||||||
|
targetType: 'inline'
|
||||||
|
script: |
|
||||||
|
$appVersion = $env:BUILD_BUILDNUMBER
|
||||||
|
$appVersionShort = $appVersion.Substring(0, $appVersion.LastIndexOf('.'))
|
||||||
|
$appVersionWithUnderscores = $appVersion.Replace('.', '_')
|
||||||
|
|
||||||
|
$versionFile = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/latest.txt"
|
||||||
|
$AppVersionShort | Set-Content "$versionFile"
|
||||||
|
|
||||||
|
$versionFileBeta = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/latestBeta.txt"
|
||||||
|
$AppVersion | Set-Content "$versionFileBeta"
|
||||||
|
pwsh: true
|
||||||
|
|
||||||
|
- task: CopyFiles@2
|
||||||
|
displayName: Copy Artifact Files
|
||||||
|
inputs:
|
||||||
|
SourceFolder: '$(Build.SourcesDirectory)'
|
||||||
|
Contents: |
|
||||||
|
src/$(ApplicationName)/VersionFeed.xml
|
||||||
|
src/$(ApplicationName)/VersionFeedBeta.xml
|
||||||
|
src/$(ApplicationName)/Art/favicon.ico
|
||||||
|
src/$(ApplicationName)/Globalization/en-US/en-US.xaml
|
||||||
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
||||||
|
OverWrite: true
|
||||||
|
flattenFolders: true
|
||||||
|
preserveTimestamp: true
|
||||||
|
|
||||||
- task: PublishBuildArtifacts@1
|
- task: PublishBuildArtifacts@1
|
||||||
displayName: 'Publish Artifacts'
|
displayName: Publish Artifacts
|
||||||
enabled: false
|
enabled: false
|
||||||
inputs:
|
inputs:
|
||||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue