1
- # Starter pipeline
2
-
3
- # Start with a minimal pipeline that you can customize to build and deploy your code.
4
- # Add steps that build, run tests, deploy, and more:
5
- # https://aka.ms/yaml
6
-
7
1
variables :
8
2
buildConfiguration : ' Release'
9
3
webDriverVersion : ' 75.0.3770.140'
16
10
vmImage : ' windows-latest'
17
11
18
12
steps :
13
+ - task : GitVersion@5
14
+ displayName : ' Run GitVersion'
15
+ inputs :
16
+ runtime : ' core'
19
17
20
18
- task : SonarCloudPrepare@1
21
19
displayName : ' Prepare SonarCloud analysis'
@@ -25,9 +23,18 @@ steps:
25
23
projectKey : ' aquality-automation_aquality-selenium-core-dotnet'
26
24
projectName : ' aquality-selenium-core-dotnet'
27
25
projectVersion : ' $(Build.BuildNumber)'
26
+ extraProperties : |
27
+ sonar.coverage.exclusions=**/**
28
28
29
29
- script : dotnet build Aquality.Selenium.Core/Aquality.Selenium.Core.sln -c $(buildConfiguration)
30
30
displayName : ' Build solution - $(buildConfiguration)'
31
+ - task : SonarCloudAnalyze@1
32
+ displayName : ' Run SonarCloud code analysis'
33
+ continueOnError : true
34
+
35
+ - task : SonarCloudPublish@1
36
+ displayName : ' Publish SonarCloud quality gate results'
37
+ continueOnError : true
31
38
32
39
- task : Windows Application Driver@0
33
40
displayName : ' Start WinAppDriver'
@@ -44,11 +51,27 @@ steps:
44
51
displayName : stop WinAppDriver
45
52
inputs :
46
53
OperationType : ' Stop'
54
+
55
+ - script : dotnet pack Aquality.Selenium.Core\src\Aquality.Selenium.Core\Aquality.Selenium.Core.csproj -c $(buildConfiguration) --no-build -p:Version=$(GitVersion.NuGetVersion) -o $(Build.ArtifactStagingDirectory)
56
+ displayName : ' Create NuGet package'
57
+ condition : and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
47
58
48
- - task : SonarCloudAnalyze@1
49
- displayName : ' Run SonarCloud code analysis'
50
- continueOnError : true
59
+ - task : NuGetCommand@2
60
+ displayName : ' Push NuGet package'
61
+ inputs :
62
+ command : ' push'
63
+ packagesToPush : ' $(Build.ArtifactStagingDirectory)/**/Aquality.Selenium.Core*.nupkg;!$(Build.ArtifactStagingDirectory)/**/Aquality.Selenium.Core*.symbols.nupkg'
64
+ nuGetFeedType : ' external'
65
+ publishFeedCredentials : ' NuGet'
66
+ condition : and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
51
67
52
- - task : SonarCloudPublish@1
53
- displayName : ' Publish SonarCloud quality gate results'
54
- continueOnError : true
68
+ - task : GitHubRelease@0
69
+ displayName : ' Create tag on GitHub'
70
+ inputs :
71
+ gitHubConnection : ' GitHub'
72
+ repositoryName : ' aquality-automation/aquality-selenium-core-dotnet'
73
+ action : ' create'
74
+ tag : ' v$(GitVersion.NuGetVersion)'
75
+ tagSource : ' manual'
76
+ isPreRelease : contains(variables['GitVersion.NuGetVersion'], '-')
77
+ condition : and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
0 commit comments