This repository has been archived by the owner on Sep 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
azure-pipelines.yml
104 lines (88 loc) · 2.64 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
trigger:
- main
pool:
vmImage: 'windows-latest'
variables:
BuildConfiguration: 'Release'
SolutionName: CG.Blazor.Forms
SolutionPath: 'src/$(SolutionName)'
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
useGlobalJson: true
- task: NuGetToolInstaller@1
inputs:
versionSpec: '5.1.0'
checkLatest: true
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: 'restore'
nugetConfigPath: 'nuget.config'
feedsToUse: config
arguments: '--interactive'
projects: '$(SolutionPath).sln'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: 'build'
arguments: '--configuration $(BuildConfiguration)'
projects: '$(SolutionPath).sln'
- task: DotNetCoreCLI@2
displayName: "dotnet test"
inputs:
command: 'test'
projects: '$(SolutionPath).sln'
arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura'
publishTestResults: true
nobuild: true
- task: PublishCodeCoverageResults@1
displayName: "publish coverage"
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: 'src/**/coverage.cobertura.xml'
pathToSources: '$(SolutionPath)'
- powershell: |
choco install docfx -y
if ($lastexitcode -ne 0) {
throw ("Error installing docfx")
}
displayName: "Install docfx"
- powershell: |
docfx docfx/docfx.json
if ($lastexitcode -ne 0) {
throw ("Error generating document")
}
displayName: "Generate docs"
- powershell: |
$env:GIT_REDIRECT_STDERR = '2>&1'
git config --global credential.helper store
Add-Content "$HOME\.git-credentials" "https://$(GIT_PAT):[email protected]`n"
git config --global user.email $(OP_USER_EMAIL)
git config --global user.name $(OP_USER)
git clone https://github.com/CodeGator/CG.Blazor.Forms.git -b gh-pages origin_site -q
Copy-Item origin_site/.git _site -recurse
CD _site
git add -A
git commit -m "CI Updates [skip ci]" -q
git push origin gh-pages -q
displayName: "Publish docs"
- task: DotNetCoreCLI@2
displayName: "dotnet pack"
inputs:
command: 'pack'
arguments: '--configuration $(BuildConfiguration)'
packagesToPack: '$(SolutionPath).sln'
nobuild: true
versioningScheme: 'off'
- task: NuGetCommand@2
displayName: 'nuget external push'
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'NUGET.ORG'
versioningScheme: 'off'
allowPackageConflicts: true
arguments: -SkipDuplicate