forked from skyyearxp/IronSnappy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
107 lines (96 loc) · 2.58 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
trigger:
batch: true
branches:
include:
- master
- develop
paths:
exclude:
- README.md
- doc/**/*
pr:
branches:
include:
- master
- develop
paths:
exclude:
- README.md
- doc/**/*
variables:
v.prefix: '1.3.0'
vmImage: 'ubuntu-latest'
stages:
- stage: Build
jobs:
- job: Core
displayName: 'Core Build'
pool:
vmImage: $(vmImage)
steps:
- script: echo "##vso[build.updatebuildnumber]$(v.prefix)"
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '3.x'
- task: DotNetCoreCLI@2
displayName: 'build all'
inputs:
command: 'build'
projects: 'src/Snappy.sln'
arguments: '-c release /p:Version=$(v.prefix)'
- task: DotNetCoreCLI@2
displayName: 'run tests'
inputs:
command: test
projects: ./src/Snappy.sln
arguments: '-c release /p:Version=$(v.prefix)'
- task: CopyFiles@2
displayName: 'copy generated nugets'
inputs:
SourceFolder: src
Contents: '**/*.*nupkg'
TargetFolder: ' $(build.artifactstagingdirectory)'
CleanTargetFolder: true
OverWrite: true
flattenFolders: true
- task: PublishBuildArtifacts@1
displayName: 'archive nugets'
inputs:
ArtifactName: nuget
- stage: Release
dependsOn: ['Build']
condition: "and( eq(variables['Build.SourceBranch'], 'refs/heads/master'), succeeded('Build') )"
jobs:
- deployment: NugetOrg
displayName: 'nuget.org public feed'
pool:
vmImage: $(vmImage)
environment: live
strategy:
runOnce:
deploy:
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'nuget'
downloadPath: '$(System.ArtifactsDirectory)'
- task: NuGetCommand@2
displayName: nuget.org
inputs:
command: push
packagesToPush: '$(System.ArtifactsDirectory)/nuget/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'nuget.org (aloneguid)'
- task: GitHubRelease@1
inputs:
gitHubConnection: 'aloneguid'
repositoryName: 'aloneguid/IronSnappy'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: '$(Build.BuildNumber)'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'