-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathazure-pipelines.yml
87 lines (73 loc) · 2.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
trigger:
- master
- develop
- feature/*
- refs/tags/*
- releases/*
variables:
solution: 'Thinktecture.EntityFrameworkCore.sln'
buildConfiguration: 'Release'
SourceBranchName: '$(Build.SourceBranchName)'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseDotNet@2
displayName: 'use .NET 8.0 SDK'
inputs:
packageType: sdk
version: 8.0.x
includePreviewVersions: false
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: UseDotNet@2
displayName: 'use .NET 9.0 SDK'
inputs:
packageType: sdk
version: 9.0.x
includePreviewVersions: false
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: UseDotNet@2
displayName: 'use .NET 9.0 SDK'
inputs:
packageType: sdk
version: 9.0.x
includePreviewVersions: false
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: |
echo dotnet --version
dotnet --version
displayName: 'print infos'
- powershell: |
Write-Host '##vso[task.setvariable variable=UseSqlServerContainer]true'
displayName: 'set env variables'
- powershell: |
. ./ci/ci.ps1
Set-VersionSuffixOnTag "$Env:BUILD_SOURCESDIRECTORY" "$Env:BUILD_SOURCEBRANCH"
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
displayName: 'set version suffix'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
configuration: '$(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
configuration: '$(buildConfiguration)'
projects: tests/**/*.csproj
- task: DotNetCoreCLI@2
displayName: 'dotnet pack'
inputs:
command: pack
projects: $(solution)
arguments: --configuration $(buildConfiguration)
- task: PublishBuildArtifacts@1
displayName: 'publish build artifacts'
inputs:
artifactName: 'NugetPackages'
- task: NuGetCommand@2
displayName: 'push to nuget.org'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'Nuget.org'