-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
azure-pipelines.yml
150 lines (135 loc) · 4.06 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
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
trigger:
batch: true
branches:
include:
- master
- rel
paths:
exclude:
- README.md
- .editorconfig
- .gitignore
pr:
branches:
include:
- master
paths:
exclude:
- README.md
- .editorconfig
- .gitignore
name: 8.1.$(Build.BuildId)
variables:
- name: VMImage
value: 'windows-2019'
- name: BuildPlatform
value: 'Any CPU'
- name: BuildConfiguration
value: Release
- group: 'Code Signing'
- group: 'GitHub Release'
stages:
- stage: build
displayName: Build NuGet Packages
jobs:
- job: buildJob
displayName: Build Prism.Plugin.Logging
pool:
vmImage: $(VMImage)
demands:
- MSBuild
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
useGlobalJson: true
- task: NuGetToolInstaller@1
displayName: Use Latest NuGet
inputs:
checkLatest: true
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
feedsToUse: config
nugetConfigPath: NuGet.config
- task: MSBuild@1
displayName: Build Prism.Plugin.Logging
inputs:
solution: Prism.Plugin.Logging.sln
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArguments: '/p:DebugType=portable /p:JavaSdkDirectory="$(JAVA_HOME)"'
- powershell: ./Sign-Packages.ps1
workingDirectory: build
displayName: Authenticode Sign Artifacts
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
SignClientClientId: $(SignClientClientId)
SignClientTenantId: $(SignClientTenantId)
SignServiceResourceId: $(SignServiceResourceId)
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))
- task: DotNetCoreCLI@2
displayName: Run Tests
inputs:
command: test
nobuild: true
projects: tests/**/*.Tests.csproj
publishTestResults: true
- task: PublishPipelineArtifact@1
displayName: Publish Package Artifacts
inputs:
artifactName: NuGet
targetPath: '$(Build.ArtifactStagingDirectory)'
- stage: deploy
displayName: Deploy to CI Feeds
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/rel')))
jobs:
- deployment: SponsorConnect
displayName: Sponsor Connect
environment: SponsorConnect
strategy:
runOnce:
deploy:
steps:
- task: NuGetCommand@2
displayName: NuGet Push
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg;$(Pipeline.Workspace)/**/*.snupkg'
nuGetFeedType: external
publishFeedCredentials: 'SponsorConnect'
- stage: deployProd
displayName: 'Deploy to NuGet.org'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/rel'))
jobs:
- deployment: NuGet
displayName: NuGet.org
environment: NuGet
strategy:
runOnce:
deploy:
steps:
- checkout: self
displayName: Get Build Resources
- powershell: build/Process-Release.ps1
displayName: Process Artifacts for Release
- task: GithubRelease@0
displayName: 'Create GitHub Release'
inputs:
githubConnection: 'GitHub - Dan Siegel'
title: '$(ReleaseDisplayName)'
tag: 'v$(VersionName)'
isPreRelease: $(IS_PREVIEW)
assets: |
$(Pipeline.Workspace)/**/*.nupkg
$(Pipeline.Workspace)/**/*.snupkg
addChangeLog: true
isDraft: true
- task: NuGetCommand@2
displayName: NuGet Push
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'NuGet'