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 0
/
azure-pipelines-1.yml
85 lines (72 loc) · 2.11 KB
/
azure-pipelines-1.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
trigger:
- main
pool:
vmImage: 'windows-latest'
variables:
solution: 'src/CG.Blue.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- checkout: self
fetchDepth: 0
- task: UseDotNet@2
displayName: 'install .NET 7.x'
inputs:
packageType: 'sdk'
version: '7.x'
includePreviewVersions: true
- task: NuGetToolInstaller@1
displayName: 'install nuget'
inputs:
versionSpec:
- task: NuGetCommand@2
displayName: 'dotnet restore'
inputs:
command: 'restore'
restoreSolution: '$(solution)'
feedsToUse: 'config'
nugetConfigPath: 'nuget.config'
- task: VSBuild@1
displayName: 'build code'
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
displayName: 'test code'
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*Tests.dll
!**\obj\**
!**\bin\**\ref\**
searchFolder: '$(System.DefaultWorkingDirectory)'
codeCoverageEnabled: true
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- 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.Blue.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"