forked from dansiegel/Prism.Plugin.Popups
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
145 lines (132 loc) · 4.13 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
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- README.md
- .editorconfig
- .gitignore
pr:
branches:
include:
- master
paths:
exclude:
- README.md
- .editorconfig
- .gitignore
name: 7.2.0.$(Build.BuildId)
variables:
- name: VMImage
value: 'windows-latest'
- 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.Popups
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.Popups
inputs:
solution: Prism.Plugin.Popups.sln
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArguments: '/p:DebugType=portable /p:JavaSdkDirectory="$(JAVA_HOME)"'
- task: DotNetCoreCLI@2
inputs:
command: test
projects: |
**\*.Tests.csproj
arguments: -c $(BuildConfiguration) --collect:"Code Coverage" -s $(System.DefaultWorkingDirectory)/CodeCoverage.runsettings /p:DebugType=portable --no-build
displayName: Run Tests
- powershell: ./Sign-Packages.ps1
workingDirectory: build
displayName: Authenticode Sign Artifacts
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
SignClientClientId: $(SignClientClientId)
SignClientTenantId: $(SignClientTenantId)
SignServiceResourceId: $(SignServiceResourceId)
condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))
- task: PublishPipelineArtifact@1
displayName: Publish Package Artifacts
inputs:
artifactName: NuGet
targetPath: '$(Build.ArtifactStagingDirectory)'
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
- stage: deploy
displayName: Deploy NuGets
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
jobs:
- deployment: SponsorConnect
displayName: SponsorConnect.dev
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'
- deployment: NuGet
displayName: NuGet.org
environment: NuGet
condition: and(succeeded(), eq(variables['IS_RELEASE'], true))
strategy:
runOnce:
deploy:
steps:
- checkout: self
displayName: Get Build Resources
- powershell: build/Process-Release.ps1
displayName: Process Artifacts for Release
- powershell: |
displayName: Process Artifacts for Deployment
- task: GitHubRelease@1
displayName: 'Create GitHub Release'
inputs:
gitHubConnection: GitHub
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;$(Pipeline.Workspace)/**/*.snupkg'
nuGetFeedType: external
publishFeedCredentials: 'NuGet'