forked from dnnsoftware/Dnn.Platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
98 lines (83 loc) · 2.74 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
pool:
vmImage: 'windows-latest'
variables:
- name: "Build.ArtifactStagingDirectory"
value: "Artifacts/"
# The following variables are defined as settable at queue time, so they cannot be included here
# Branch.CdfProvider: dnn
# Branch.CkEditor: development
# CakeTarget: BuildAll
# CakeVerbosity: Normal # valid values include Quiet, Minimal, Normal, Verbose, Diagnostic
# ReleaseMode: Beta
# RunTests: True
trigger:
batch: true
branches:
include:
- '*'
pr:
autoCancel: true
branches:
include:
- '*'
steps:
- task: PowerShell@2
displayName: 'Run DNN Update Versions'
inputs:
targetType: filePath
filePath: ./build.ps1
arguments: '--target=BuildServerSetVersion --verbosity=$(CakeVerbosity)'
- script: 'sqllocaldb start mssqllocaldb'
displayName: 'Start Sql LocalDb Service'
condition: and(succeeded(), eq(variables['RunTests'], 'True'))
- powershell: 'npm config set registry https://www.myget.org/F/dnn-software-public/npm/'
displayName: 'npm config set registry'
enabled: false
- powershell: |
$path = '.\DNN Platform\Library\Properties\AssemblyInfo.cs'
$pattern3 = '\[assembly: AssemblyStatus'
(Get-Content $path) | ForEach-Object{
if($_ -match $pattern3){
# We have found the matching line
'[assembly: AssemblyStatus(ReleaseMode.{0})]' -f '$(ReleaseMode)'
} else {
$_
}
} | Set-Content $path
displayName: 'Update Alpha/Beta/Stable flag'
- task: PowerShell@2
displayName: 'Run DNN Build via Cake'
inputs:
targetType: filePath
filePath: ./build.ps1
arguments: '--target=$(CakeTarget) --verbosity=$(CakeVerbosity) --CkBranch="$(Branch.CkEditor)" --CdfBranch="$(Branch.CdfProvider)"'
- task: PowerShell@2
displayName: 'Run Unit Tests via Cake'
inputs:
targetType: filePath
filePath: ./build.ps1
arguments: '--target=UnitTests --verbosity=$(CakeVerbosity)'
continueOnError: true
condition: and(succeeded(), eq(variables['RunTests'], 'True'))
- task: PublishTestResults@2
displayName: 'Publish Test Results **/TestResults/*.xml'
inputs:
testResultsFormat: VSTest
testResultsFiles: '**/TestResults/*.xml'
mergeTestResults: true
failTaskOnFailedTests: true
condition: eq(variables['RunTests'], 'True')
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
PathtoPublish: Artifacts
ArtifactName: Artifacts
continueOnError: true
- task: NuGetCommand@2
displayName: 'Publish to MyGet'
inputs:
command: push
packagesToPush: 'Artifacts/**/*.nupkg;!Artifacts/**/*.symbols.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'DNN-NuGet-MyGet'
enabled: false