-
Notifications
You must be signed in to change notification settings - Fork 28
/
azure-pipelines.yml
105 lines (92 loc) · 3.01 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
trigger:
branches:
include:
- master
- develop
- release/*
- hotfix/*
pr:
branches:
include:
- '*'
pool:
name: 'Default'
variables:
# patch will be incremented at each build. This is useful to create a unique build version.
patch: $[counter('VersionCounter', 200)]
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
name: 4.0.$(patch) # Set the value of $(Build.BuildNumber)
steps:
# Patch the shared assembly info
- task: Assembly-Info-NetFramework@2
displayName: 'Patch Assembly Versions'
inputs:
Path: '$(Build.SourcesDirectory)'
FileNames: 'src\SharedAssemblyVersion.cs'
InsertAttributes: false
FileEncoding: 'auto'
WriteBOM: false
VersionNumber: '$(Build.BuildNumber)'
FileVersionNumber: '$(Build.BuildNumber)'
# Patch the VSIX version
- powershell: |
$version = $env:BUILD_NUMBER
Write-Host "Set version: $version"
$FullPath = Resolve-Path .\src\Sitecore.Rocks.VisualStudio\source.extension.vsixmanifest
Write-Host $FullPath
[xml]$content = Get-Content $FullPath
$content.PackageManifest.Metadata.Identity.Version = $version
$content.Save($FullPath)
displayName: 'Patch VSIX Version'
env:
BUILD_NUMBER: $(Build.BuildNumber)
# Install latest NuGet
- task: NuGetToolInstaller@1
displayName: 'NuGet Install'
inputs:
checkLatest: true
# NuGet restore
- task: NuGetCommand@2
displayName: 'NuGet Restore'
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'config'
nugetConfigPath: 'nuget.config'
# Solution build
- task: VSBuild@1
displayName: 'VSIX Build'
inputs:
solution: '**\*.sln'
maximumCpuCount: true
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
# Sitecore.Rocks.Server publish
- task: MSBuild@1
displayName: 'Sitecore.Rocks.Server Build'
inputs:
solution: '.\src\Sitecore.Rocks.Server\Sitecore.Rocks.Server.csproj'
platform: 'AnyCPU'
configuration: 'Release'
msbuildArguments: '/p:DeployOnBuild=true /p:PublishProfile=FilesystemPublish'
# Sitecore.Rocks.Server Update Package
- powershell: |
Install-Module -Name Sitecore.Courier -Scope CurrentUser -Force
New-CourierPackage -Target ".\src\Sitecore.Rocks.Server\bin\Release\Publish" -Output ".\src\Sitecore.Rocks.Server\bin\Sitecore.Rocks.Server.update" -IncludeFiles $true -SerializationProvider "Sitecore"
displayName: 'Sitecore.Rocks.Server Update Package Build'
# Publish Artifacts
- task: PublishBuildArtifacts@1
displayName: 'Publish VSIX Artifact'
inputs:
pathtoPublish: 'src\Sitecore.Rocks.VisualStudio\bin\Release\Sitecore.Rocks.VisualStudio.vsix'
artifactName: 'Sitecore.Rocks.VisualStudio.vsix'
publishLocation: Container
- task: PublishBuildArtifacts@1
displayName: 'Publish Update Package Artifact'
inputs:
pathtoPublish: 'src\Sitecore.Rocks.Server\bin\Sitecore.Rocks.Server.update'
artifactName: 'Sitecore.Rocks.Server.update'
publishLocation: Container