forked from NWebsec/NWebsec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
53 lines (44 loc) · 1.52 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
#trigger:
#- master
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
sln: 'NWebsec-CI.sln'
versionSuffix: '' #overridden for branches before pack.
nugetConnection: 'NWebsec Nuget'
steps:
- task: UseDotNet@2
displayName: ".NET Core 3.1.x"
inputs:
version: '3.1.x'
packageType: sdk
- task: DotNetCoreCLI@2
displayName: 'Build'
inputs:
command: build
projects: '$(sln)'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Test'
inputs:
command: test
projects: $(sln)
nobuild: true
arguments: '--configuration $(buildConfiguration)'
- script: echo "##vso[task.setvariable variable=versionSuffix]--version-suffix $(Build.BuildID).$(Build.SourceBranchName)"
condition: and(succeeded(), ne(variables['Build.SourceBranchName'], 'master'))
displayName: 'Version suffix'
- script: dotnet pack $(sln) --configuration $(buildConfiguration) --no-build -o $(Build.ArtifactStagingDirectory)\nupkgs $(versionSuffix)
displayName: 'Pack'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)\nupkgs'
artifactName: 'nwebsec-$(Build.BuildID)'
- task: DotNetCoreCLI@2
condition: and(succeeded(), in(variables['Build.SourceBranchName'], 'master', 'beta', 'rc'))
displayName: 'dotnet nuget push'
inputs:
command: custom
custom: nuget
arguments: 'push $(Build.ArtifactStagingDirectory)\nupkgs\*.nupkg -k $(nugetApiKey) -s https://api.nuget.org/v3/index.json --skip-duplicate'