-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
88 lines (77 loc) · 2.2 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
88
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/*
- test/*
- azure-pipelines.yml
pr:
branches:
include:
- "*"
pool:
vmImage: "ubuntu-latest"
variables:
- group: simplic-deployment
- group: simplic-deployment-dev02
- name: buildConfiguration
value: "Release"
- name: dotNetVersion
value: '8.0.x'
resources:
repositories:
- repository: infrastructure
type: github
name: simplic/build-infrastructure
endpoint: simplic-bot
steps:
- task: UseDotNet@2
inputs:
version: $(dotNetVersion)
includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: 'Restore solution'
inputs:
command: 'restore'
projects: '**/*.sln'
feedsToUse: 'select'
vstsFeed: 'f7087ef5-bf6f-48b2-8b8b-5e513f4a7a9e'
- ${{ if not(eq(variables['Build.Reason'], 'PullRequest')) }}:
- template: version-number-update-token-template.yml@infrastructure
parameters:
connection_string: $(connection_string)
git_user: $(git_user)
git_token: $(git_token)
branch_name: ${{ replace(variables['Build.SourceBranch'], 'refs/heads/', '') }}
- task: DotNetCoreCLI@2
displayName: 'Build solution'
inputs:
command: 'build'
projects: '**/*.sln'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Execute and publish tests'
inputs:
command: 'test'
projects: '**/*.sln'
- task: DotNetCoreCLI@2
displayName: 'Create nuget packages'
inputs:
command: 'pack'
packagesToPack: '**/*.sln'
configuration: '$(buildConfiguration)'
nobuild: true
versioningScheme: 'off'
packDirectory: '$(Build.ArtifactStagingDirectory)'
- task: NuGetCommand@2
displayName: 'Publish nuget packages'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'f7087ef5-bf6f-48b2-8b8b-5e513f4a7a9e'
allowPackageConflicts: true