forked from Kros-sk/Kros.KORM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.yml
63 lines (53 loc) · 1.46 KB
/
build.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
trigger:
tags:
include:
- v*
pool: Default
resources:
repositories:
- repository: templates
type: git
name: DevShared/Templates
variables:
- group: Nuget
- name: buildConfiguration
value: 'Release'
- name: projectName
value: 'Kros.KORM'
steps:
- template: steps/agent-info.yml@templates
- template: steps/delete-nupkgs.yml@templates
- task: DotNetCoreCLI@2
displayName: 'Nuget restore'
inputs:
command: 'restore'
projects: '**/$(projectName).csproj'
- task: FileTransform@1
inputs:
folderPath: '$(System.DefaultWorkingDirectory)'
fileType: 'json'
targetFiles: '**/*[Tt]ests*/appsettings.json'
- task: DotNetCoreCLI@2
displayName: 'Build'
inputs:
command: build
projects: '**/$(projectName).csproj'
arguments: '--configuration $(BuildConfiguration) --no-restore'
- task: DotNetCoreCLI@2
displayName: 'Tests'
inputs:
command: test
projects: '**/$(projectName).UnitTests.csproj'
- task: CopyFiles@2
displayName: 'Copy package files to staging directory'
inputs:
Contents: '**/$(projectName)*.nupkg'
TargetFolder: '$(build.artifactStagingDirectory)'
FlattenFolders: true
- task: NuGetCommand@2
displayName: 'Nuget push to $(nuget.feed)'
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: $(nuget.feed)
packagesToPush: '$(build.artifactStagingDirectory)/**/*.nupkg'