-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
79 lines (77 loc) · 2.32 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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
branches:
include:
- '*'
paths:
include:
- src/*
- tests/*
tags:
include:
- '*'
pool:
vmImage: 'windows-2022'
stages:
- stage: Build
jobs:
- job:
steps:
- task: gitversion/setup@0
inputs:
versionSpec: '5.x'
preferLatestVersion: true
- task: gitversion/execute@0
inputs:
configFilePath: 'GitVersion.yml'
additionalArguments: '/output json'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: '**/*tests.csproj'
configuration: '$(Build.Configuration)'
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*tests*.dll
!**\*TestAdapter.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
- task: DotNetCoreCLI@2
inputs:
command: 'pack'
packagesToPack: '**/*.csproj'
versioningScheme: 'off'
buildProperties: 'PackageVersion=$(GITVERSION.SEMVER);AssemblyVersion=$(GITVERSION.ASSEMBLYSEMVER);InformationalVersion=$(GITVERSION.INFORMATIONALVERSION)'
verbosityPack: 'Normal'
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: drop
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
get-childitem Env:
- stage: Release
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
jobs:
- job:
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: drop
itemPattern: '**/*.nupkg'
downloadPath: '$(System.ArtifactsDirectory)'
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(System.ArtifactsDirectory)/**/*.nupkg;!$(System.ArtifactsDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'nuget.org'