-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipeline.yml
107 lines (93 loc) · 3.09 KB
/
azure-pipeline.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
pool:
vmImage: "windows-2019"
trigger:
batch: true
branches:
include:
- master
- release/*
- hotfix/*
- feature/*
exclude:
- "**/*-restyled"
pr:
branches:
include:
- master
- release/*
- hotfix/*
- feature/*
exclude:
- "**/*-restyled"
variables:
Release.IsPrerelease: $[and(ne(variables['Build.Reason'], 'PullRequest'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/')))]
Release.Publish: $[and(ne(variables['Build.Reason'], 'PullRequest'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))]
steps:
- task: GitVersion@5
inputs:
runtime: "core"
configFilePath: "gitversion.yml"
- task: UseDotNet@2
displayName: "Use .Net Core sdk "
inputs:
useGlobalJson: true
- task: DotNetCoreCLI@2
displayName: "dotnet build"
- task: UseDotNet@2
inputs:
packageType: "runtime"
version: "1.1.2"
- task: DotNetCoreCLI@2
displayName: "dotnet test"
inputs:
command: test
- powershell: Invoke-WebRequest -Uri 'https://report.ci/upload.py' -OutFile upload.py
- task: PythonScript@0
displayName: Upload Test Results
continueOnError: true
inputs:
scriptPath: upload.py
arguments: "--include='*.xml' --framework=nunit"
- task: CopyFiles@2
displayName: "Copy Files to: $(build.artifactstagingdirectory)"
inputs:
SourceFolder: "$(system.defaultworkingdirectory)"
Contents: |
**\*.nupkg
**\*.snupkg
TargetFolder: "$(build.artifactstagingdirectory)"
flattenFolders: true
condition: succeededOrFailed()
- task: DotNetCoreCLI@2
displayName: "dotnet push"
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
command: push
publishVstsFeed: "0a220c4b-5ab8-47bf-baf0-fdfb139b70c4/faf9ee1b-b648-43cb-9a50-c60ae34d9adf"
includesymbols: true
- task: NuGetToolInstaller@1
condition: and(succeeded(), eq(variables['Release.Publish'], 'True'))
inputs:
versionSpec: ">4.9.0"
- task: NuGetCommand@2
displayName: "Publish to NuGet.org"
condition: and(succeeded(), eq(variables['Release.Publish'], 'True'))
inputs:
command: "push"
packagesToPush: "$(Build.ArtifactStagingDirectory)/**/*.nupkg;"
nuGetFeedType: "external"
publishFeedCredentials: "Nuget (SettingService)"
- task: GitHubRelease@0
displayName: "GitHub release (create)"
condition: and(succeeded(), eq(variables['Release.Publish'], 'True'))
inputs:
gitHubConnection: "phirSOFT.SettingsService"
repositoryName: "$(Build.Repository.Name)"
action: "create"
target: "$(Build.SourceVersion)"
tagSource: "manual"
tag: "$(GitVersion.FullSemVer)"
title: "$(GitVersion.FullSemVer)"
releaseNotesFile: "ReleaseNotes.md"
isPreRelease: $(Release.IsPrerelease)
compareWith: "lastFullRelease"