-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
78 lines (71 loc) · 2.02 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
trigger:
branches:
include:
- main
paths:
exclude:
- '*.md'
pr:
branches:
include:
- main
paths:
exclude:
- '*.md'
pool:
vmImage: 'windows-latest'
parameters:
- name: deploy
displayName: Deploy
type: boolean
default: false
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
stages:
- stage: Build_Test
displayName: Build and Test
jobs:
- job: Build_Test
displayName: Build and Test
steps:
- bash: dotnet tool install Cake.Tool --version 1.3.0 --global
displayName: Install Cake Tool
- bash: dotnet cake
displayName: Build and Test
- bash: ./cicd/package.sh $(Build.SourceBranchName)
condition:
in(
succeeded(),
and(succeeded(), eq('${{ parameters.deploy }}', 'true')),
and(succeeded(), startsWith(variables['Build.SourceBranchName'], 'v'))
)
displayName: Build Package
- publish: $(System.DefaultWorkingDirectory)/src/PgPartner/bin/Release
displayName: Publish Release Artifacts
artifact: NuGetPackage
condition:
in(
succeeded(),
and(succeeded(), eq('${{ parameters.deploy }}', 'true')),
and(succeeded(), startsWith(variables['Build.SourceBranchName'], 'v'))
)
- stage: Deploy
dependsOn: Build_Test
condition:
in(
succeeded(),
and(succeeded(), eq('${{ parameters.deploy }}', 'true')),
and(succeeded(), startsWith(variables['Build.SourceBranchName'], 'v'))
)
jobs:
- job: Deploy
steps:
- task: DownloadPipelineArtifact@2
displayName: Download Release Artifacts
inputs:
artifact: NuGetPackage
path: $(System.DefaultWorkingDirectory)/Release
- bash: ./cicd/deploy.sh $(NUGET_KEY)
displayName: Deploy