-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
153 lines (134 loc) · 4.73 KB
/
azure-pipelines.yml
File metadata and controls
153 lines (134 loc) · 4.73 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# .NET Core
# Build and test NET Core projects.
trigger:
- master
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
pool: 'Default'
pushPreview: 'internal;nuget.org'
nugetVersion: ""
releaseSkip: 'true'
resources:
repositories:
- repository: templates
type: github
name: Amith211/azure-pipelines-templates
ref: refs/heads/master
endpoint: Amith211
stages:
- template: .net/stages/build.yml@templates
parameters:
dotNetCoreInstallerVersion: '2.2.300'
pool: $(pool)
- template: .net/stages/test.yml@templates
## Preview release ##
- stage: DeployPreview
displayName: 'Deploy Preview'
jobs:
- job: NugetPackPreview
displayName: 'Pack Nuget preview'
pool:
name: $(pool)
#vmImage: 'windows-latest'
steps:
- checkout: none
- template: .net/steps/load-variables.yml@templates
- task: DownloadPipelineArtifact@1
inputs:
artifactName: 'drop'
targetPath: '$(Build.SourcesDirectory)'
- task: Powershell@2
name: SetNugetSemVerVersion
displayName: SetNugetSemVerVersion
inputs:
targetType: inline
script: |
. $(Build.SourcesDirectory)/build/Set-NugetSemVersion.ps1
Get-NugetVersion -IsPreview;
- template: .net/steps/nuget-pack.yml@templates
parameters:
artifactName: 'nuget-preview'
nugetPackageVersion: $(SetNugetSemVerVersion.nugetVersionOutput)
- template: .net/jobs/nuget-push-to-azureArtifacts.yml@templates
parameters:
jobName: 'DeployNugetPreviewAzureArtifacts'
jobDisplayName: 'Deploy Preview to Azure Artifacts'
azureDevOpsOrg: 'Amith211'
pool: ${{ variables.pool }}
artifactName: 'nuget-preview'
publishDevOpsFeed: '/b4573900-0d0d-4915-b6b5-cfc2fee08f7d'
islegacyDevOpsUrl: true
allowPackageConflicts: true
environment: 'Preview'
# Use when YAML Gates are implemented
# - template: .net/jobs/nuget-push-to-nuget.yml@templates
# parameters:
# jobName: 'DeployNugetPreview'
# jobDisplayName: 'Deploy to Nuget.org'
# pool: ${{ variables.pool }}
# artifactName: 'nuget-preview'
# nuGetServiceConnections: 'Nuget.org'
# allowPackageConflicts: true
# nugetPackageVersion: $(DeployRelease.SetNugetSemVerVersion.nugetVersionOutput)
# environment: 'Release'
condition: >
or(ne(variables['Build.Reason'], 'PullRequest'),
startswith(variables['Build.SourceBranch'], 'refs/heads/azure-pipelines-test') )
## condition - Don't run stage if pull request unless it's an azure-pipelines test branch'
## Stable Release ##
- stage: DeployRelease
displayName: 'Deploy Release'
jobs:
- job: NugetPackRelease
displayName: 'Pack Nuget Release'
pool:
name: ${{ variables.pool }}
#vmImage: 'windows-latest'
steps:
- checkout: none
- template: .net/steps/load-variables.yml@templates
- task: DownloadPipelineArtifact@1
inputs:
artifactName: 'drop'
targetPath: '$(Build.SourcesDirectory)'
- task: Powershell@2
name: SetNugetSemVerVersion
displayName: SetNugetSemVerVersion
inputs:
targetType: inline
script: |
. $(Build.SourcesDirectory)/build/Set-NugetSemVersion.ps1
Get-NugetVersion;
- template: .net/steps/nuget-pack.yml@templates
parameters:
artifactName: 'nuget'
nugetPackageVersion: $(SetNugetSemVerVersion.nugetVersionOutput)
- template: .net/jobs/nuget-push-to-azureArtifacts.yml@templates
parameters:
jobName: 'DeployNugetAzureArtifacts'
jobDisplayName: 'Deploy to Azure Artifacts'
azureDevOpsOrg: 'Amith211'
pool: ${{ variables.pool }}
artifactName: 'nuget'
publishDevOpsFeed: '/b4573900-0d0d-4915-b6b5-cfc2fee08f7d'
islegacyDevOpsUrl: true
allowPackageConflicts: true
environment: 'Release'
- template: .net/jobs/nuget-push-to-nuget.yml@templates
parameters:
jobName: 'DeployNuget'
jobDisplayName: 'Deploy to Nuget.org'
pool: ${{ variables.pool }}
artifactName: 'nuget'
nuGetServiceConnections: 'Nuget.org'
allowPackageConflicts: true
nugetPackageVersion: $(DeployRelease.SetNugetSemVerVersion.nugetVersionOutput)
environment: 'Release'
condition: >
and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'),
or(eq(variables['Build.SourceBranch'], 'refs/heads/master'),
startswith(variables['Build.SourceBranch'], 'refs/heads/release/'),
startswith(variables['Build.SourceBranch'], 'refs/heads/azure-pipelines-test')) )
##condition - run only if master or release otherwise it is a prerelease allreay deployed in previous stage