forked from oxyplot/oxyplot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
134 lines (123 loc) · 4.31 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
134 lines (123 loc) · 4.31 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
trigger:
- develop
pool:
name: Default
resources:
repositories:
- repository: evoleapdevops
type: github
name: evoleap/devops
endpoint: evoleap
variables:
BuildPlatform: 'Any CPU'
BuildConfiguration: 'Release'
prBuild: $[contains(variables['Build.SourceBranch'], '/merge')]
workingVersion: ''
symVer: ''
verPrefix: ''
verSuffix: ''
steps:
- checkout: self
- checkout: evoleapdevops
# Get version from Version.txt using devops template
- template: templates/get-working-version.yml@evoleapdevops
parameters:
source: 'oxyplot/Version.txt'
dest: 'oxyplot/WorkingVersion.txt'
var: 'workingVersion'
symVar: 'symVer'
repo: devops
verPrefixVar: 'verPrefix'
verSuffixVar: 'verSuffix'
# Set package version: workingVersion for normal builds, symVer for PR builds
- bash: |
if [ "$(prBuild)" = "True" ]; then
echo "##vso[task.setvariable variable=packageVersion]$(symVer)"
else
echo "##vso[task.setvariable variable=packageVersion]$(workingVersion)"
fi
displayName: 'Set package version'
# Update version in GlobalAssemblyInfo.cs
- template: templates/replace-version-text.yml@evoleapdevops
parameters:
repo: devops
file: oxyplot/Source/GlobalAssemblyInfo.cs
version: $(workingVersion)
replacements: '"AssemblyVersion\(""[\d.]+""\)","AssemblyVersion(""{0}.{1}.{2}.{3}"")","AssemblyFileVersion\(""[\d.]+""\)","AssemblyFileVersion(""{0}.{1}.{2}.{3}"")","AssemblyInformationalVersion\(""[^""]*""\)","AssemblyInformationalVersion(""{0}.{1}.{2}.{3}"")"'
# Update version in nuspec files
- template: templates/replace-version-text.yml@evoleapdevops
parameters:
repo: devops
file: oxyplot/evoleap.OxyPlot.Wpf.nuspec
version: $(packageVersion)
replacements: '"<version>[^<]+</version>","<version>$(packageVersion)</version>"'
# Restore and build .NET 4.8 solution (OxyPlot.WPF.sln)
- task: DotNetCoreCLI@2
displayName: 'Restore NuGet packages for OxyPlot.WPF.sln'
inputs:
command: 'restore'
projects: 'oxyplot/Source/OxyPlot.WPF.sln'
feedsToUse: 'select'
- task: MSBuild@1
displayName: 'Build solution Source/OxyPlot.WPF.sln'
inputs:
solution: oxyplot/Source/OxyPlot.WPF.sln
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArguments: '/p:StyleCopTreatErrorsAsWarnings="True"'
restoreNugetPackages: true
# Restore, build and test .NET 8 solution (OxyPlot.core.sln)
- task: DotNetCoreCLI@2
displayName: 'Restore NuGet packages for OxyPlot.core.sln'
inputs:
command: 'restore'
projects: 'oxyplot/Source/OxyPlot.core.sln'
feedsToUse: 'select'
- task: DotNetCoreCLI@2
displayName: 'Build OxyPlot.core.sln'
inputs:
command: 'build'
projects: 'oxyplot/Source/OxyPlot.core.sln'
arguments: '--configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Test OxyPlot.core.sln'
inputs:
command: 'test'
projects: 'oxyplot/Source/OxyPlot.core.sln'
arguments: '--configuration $(BuildConfiguration)'
# Package and publish NuGet packages
- task: NuGetCommand@2
displayName: 'NuGet pack evoleap.OxyPlot.Wpf'
inputs:
command: 'pack'
packagesToPack: 'oxyplot/evoleap.OxyPlot.Wpf.nuspec'
packDestination: '$(Build.ArtifactStagingDirectory)'
versioningScheme: 'off'
- task: DotNetCoreCLI@2
displayName: 'Pack evoleap.OxyPlot.core'
inputs:
command: 'pack'
packagesToPack: 'oxyplot/Source/OxyPlot/OxyPlot.core.csproj'
configuration: '$(BuildConfiguration)'
packDirectory: '$(Build.ArtifactStagingDirectory)'
nobuild: true
versioningScheme: 'byEnvVar'
versionEnvVar: 'packageVersion'
- task: DotNetCoreCLI@2
displayName: 'Pack evoleap.OxyPlot.Wpf.core'
inputs:
command: 'pack'
packagesToPack: 'oxyplot/Source/OxyPlot.Wpf/OxyPlot.Wpf.core.csproj'
configuration: '$(BuildConfiguration)'
packDirectory: '$(Build.ArtifactStagingDirectory)'
nobuild: true
versioningScheme: 'byEnvVar'
versionEnvVar: 'packageVersion'
- task: NuGetCommand@2
displayName: 'NuGet push'
condition: and(succeeded(), not(eq(variables['prBuild'], 'True')))
inputs:
command: push
packagesToPush: '$(Build.ArtifactStagingDirectory)/evoleap.OxyPlot*.nupkg;!$(Build.ArtifactStagingDirectory)/evoleap.OxyPlot*.symbols.nupkg'
publishVstsFeed: '4e2dc0fe-c532-420e-8889-18ca9bea1ff1'
allowPackageConflicts: true